home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1999 July: Mac OS SDK / Dev.CD Jul 99 SDK1.toast / Development Kits / Mac OS / Interfaces&Libraries / Universal / Interfaces / CIncludes / QuickTimeMusic.h < prev    next >
Encoding:
C/C++ Source or Header  |  1998-08-17  |  83.4 KB  |  2,086 lines  |  [TEXT/MPS ]

  1. /*
  2.      File:        QuickTimeMusic.h
  3.  
  4.      Contains:    QuickTime Interfaces.
  5.  
  6.      Version:    Technology:    QuickTime 3.0
  7.                  Release:    Universal Interfaces 3.2
  8.  
  9.      Copyright:    © 1990-1998 by Apple Computer, Inc., all rights reserved
  10.  
  11.      Bugs?:        For bug reports, consult the following page on
  12.                  the World Wide Web:
  13.  
  14.                      http://developer.apple.com/bugreporter/
  15.  
  16. */
  17. #ifndef __QUICKTIMEMUSIC__
  18. #define __QUICKTIMEMUSIC__
  19.  
  20. #ifndef __COMPONENTS__
  21. #include <Components.h>
  22. #endif
  23. #ifndef __IMAGECOMPRESSION__
  24. #include <ImageCompression.h>
  25. #endif
  26. #ifndef __MOVIES__
  27. #include <Movies.h>
  28. #endif
  29. #ifndef __QUICKDRAW__
  30. #include <Quickdraw.h>
  31. #endif
  32. #ifndef __VIDEO__
  33. #include <Video.h>
  34. #endif
  35. #ifndef __MACMEMORY__
  36. #include <MacMemory.h>
  37. #endif
  38. #ifndef __SOUND__
  39. #include <Sound.h>
  40. #endif
  41. #ifndef __ENDIAN__
  42. #include <Endian.h>
  43. #endif
  44.  
  45.  
  46.  
  47. #if PRAGMA_ONCE
  48. #pragma once
  49. #endif
  50.  
  51. #ifdef __cplusplus
  52. extern "C" {
  53. #endif
  54.  
  55. #if PRAGMA_IMPORT
  56. #pragma import on
  57. #endif
  58.  
  59. #if PRAGMA_STRUCT_ALIGN
  60.     #pragma options align=mac68k
  61. #elif PRAGMA_STRUCT_PACKPUSH
  62.     #pragma pack(push, 2)
  63. #elif PRAGMA_STRUCT_PACK
  64.     #pragma pack(2)
  65. #endif
  66.  
  67.  
  68. enum {
  69.     kaiToneDescType                = FOUR_CHAR_CODE('tone'),
  70.     kaiNoteRequestInfoType        = FOUR_CHAR_CODE('ntrq'),
  71.     kaiKnobListType                = FOUR_CHAR_CODE('knbl'),
  72.     kaiKeyRangeInfoType            = FOUR_CHAR_CODE('sinf'),
  73.     kaiSampleDescType            = FOUR_CHAR_CODE('sdsc'),
  74.     kaiSampleInfoType            = FOUR_CHAR_CODE('smin'),
  75.     kaiSampleDataType            = FOUR_CHAR_CODE('sdat'),
  76.     kaiSampleDataQUIDType        = FOUR_CHAR_CODE('quid'),
  77.     kaiInstInfoType                = FOUR_CHAR_CODE('iinf'),
  78.     kaiPictType                    = FOUR_CHAR_CODE('pict'),
  79.     kaiWriterType                = FOUR_CHAR_CODE('©wrt'),
  80.     kaiCopyrightType            = FOUR_CHAR_CODE('©cpy'),
  81.     kaiOtherStrType                = FOUR_CHAR_CODE('str '),
  82.     kaiInstrumentRefType        = FOUR_CHAR_CODE('iref'),
  83.     kaiInstGMQualityType        = FOUR_CHAR_CODE('qual'),
  84.     kaiLibraryInfoType            = FOUR_CHAR_CODE('linf'),
  85.     kaiLibraryDescType            = FOUR_CHAR_CODE('ldsc')
  86. };
  87.  
  88.  
  89. struct InstLibDescRec {
  90.     Str31                             libIDName;
  91. };
  92. typedef struct InstLibDescRec            InstLibDescRec;
  93.  
  94. struct InstKnobRec {
  95.     BigEndianLong                     number;
  96.     BigEndianLong                     value;
  97. };
  98. typedef struct InstKnobRec                InstKnobRec;
  99.  
  100. enum {
  101.     kInstKnobMissingUnknown        = 0,
  102.     kInstKnobMissingDefault        = (1 << 0)
  103. };
  104.  
  105.  
  106. struct InstKnobList {
  107.     BigEndianLong                     knobCount;
  108.     BigEndianLong                     knobFlags;
  109.     InstKnobRec                     knob[1];
  110. };
  111. typedef struct InstKnobList                InstKnobList;
  112.  
  113. enum {
  114.     kMusicLoopTypeNormal        = 0,
  115.     kMusicLoopTypePalindrome    = 1                                /* back & forth*/
  116. };
  117.  
  118.  
  119. enum {
  120.     instSamplePreProcessFlag    = 1 << 0
  121. };
  122.  
  123.  
  124. struct InstSampleDescRec {
  125.     BigEndianOSType                 dataFormat;
  126.     BigEndianShort                     numChannels;
  127.     BigEndianShort                     sampleSize;
  128.     BigEndianUnsignedFixed             sampleRate;
  129.     BigEndianShort                     sampleDataID;
  130.     BigEndianLong                     offset;                        /* offset within SampleData - this could be just for internal use*/
  131.     BigEndianLong                     numSamples;                    /* this could also just be for internal use, we'll see*/
  132.  
  133.     BigEndianLong                     loopType;
  134.     BigEndianLong                     loopStart;
  135.     BigEndianLong                     loopEnd;
  136.  
  137.     BigEndianLong                     pitchNormal;
  138.     BigEndianLong                     pitchLow;
  139.     BigEndianLong                     pitchHigh;
  140. };
  141. typedef struct InstSampleDescRec        InstSampleDescRec;
  142.  
  143. typedef Handle                             AtomicInstrument;
  144. typedef Ptr                             AtomicInstrumentPtr;
  145.  
  146. enum {
  147.     kQTMIDIComponentType        = FOUR_CHAR_CODE('midi')
  148. };
  149.  
  150.  
  151. enum {
  152.     kOMSComponentSubType        = FOUR_CHAR_CODE('OMS '),
  153.     kFMSComponentSubType        = FOUR_CHAR_CODE('FMS '),
  154.     kMIDIManagerComponentSubType = FOUR_CHAR_CODE('mmgr')
  155. };
  156.  
  157. typedef ComponentInstance                 QTMIDIComponent;
  158.  
  159. enum {
  160.     kMusicPacketPortLost        = 1,                            /* received when application loses the default input port */
  161.     kMusicPacketPortFound        = 2,                            /* received when application gets it back out from under someone else's claim */
  162.     kMusicPacketTimeGap            = 3                                /* data[0] = number of milliseconds to keep the MIDI line silent */
  163. };
  164.  
  165.  
  166. enum {
  167.     kAppleSysexID                = 0x11,                            /* apple sysex is followed by 2-byte command. 0001 is the command for samplesize */
  168.     kAppleSysexCmdSampleSize    = 0x0001,                        /* 21 bit number in 3 midi bytes follows sysex ID and 2 cmd bytes */
  169.     kAppleSysexCmdSampleBreak    = 0x0002,                        /* specifies that the sample should break right here */
  170.     kAppleSysexCmdAtomicInstrument = 0x0010,                    /* contents of atomic instrument handle */
  171.     kAppleSysexCmdDeveloper        = 0x7F00                        /* F0 11 7F 00 ww xx yy zz ... F7 is available for non-Apple developers, where wxyz is unique app signature with 8th bit cleared, unique to developer, and 00 and 7f are reserved */
  172. };
  173.  
  174.  
  175. struct MusicMIDIPacket {
  176.     unsigned short                     length;
  177.     unsigned long                     reserved;                    /* if length zero, then reserved = above enum */
  178.     UInt8                             data[249];
  179. };
  180. typedef struct MusicMIDIPacket            MusicMIDIPacket;
  181. typedef CALLBACK_API( ComponentResult , MusicMIDISendProcPtr )(ComponentInstance self, long refCon, MusicMIDIPacket *mmp);
  182. typedef STACK_UPP_TYPE(MusicMIDISendProcPtr)                     MusicMIDISendUPP;
  183. typedef CALLBACK_API( ComponentResult , MusicMIDIReadHookProcPtr )(MusicMIDIPacket *mp, long myRefCon);
  184. typedef STACK_UPP_TYPE(MusicMIDIReadHookProcPtr)                 MusicMIDIReadHookUPP;
  185.  
  186. enum {
  187.     kSynthesizerConnectionFMS    = 1,                            /* this connection imported from FMS */
  188.     kSynthesizerConnectionMMgr    = 2,                            /* this connection imported from the MIDI Mgr */
  189.     kSynthesizerConnectionOMS    = 4,                            /* this connection imported from OMS */
  190.     kSynthesizerConnectionQT    = 8,                            /* this connection is a QuickTime-only port */
  191.                                                                 /* lowest four bits are mutually exclusive; combinations reserved for future use.*/
  192.     kSynthesizerConnectionUnavailable = 256                        /* port exists, but cannot be used just now */
  193. };
  194.  
  195.  
  196. struct SynthesizerConnections {
  197.     OSType                             clientID;
  198.     OSType                             inputPortID;                /* terminology death: this port is used to SEND to the midi synth */
  199.     OSType                             outputPortID;                /* terminology death: this port receives from a keyboard or other control device */
  200.     long                             midiChannel;                /* The system channel; others are configurable (or the nubus slot number) */
  201.     long                             flags;
  202.     long                             unique;                        /* unique id may be used instead of index, to getinfo and unregister calls */
  203.     long                             reserved1;                    /* should be zero */
  204.     long                             reserved2;                    /* should be zero */
  205. };
  206. typedef struct SynthesizerConnections    SynthesizerConnections;
  207.  
  208. struct QTMIDIPort {
  209.     SynthesizerConnections             portConnections;
  210.     Str63                             portName;
  211. };
  212. typedef struct QTMIDIPort                QTMIDIPort;
  213.  
  214. struct QTMIDIPortList {
  215.     short                             portCount;
  216.     QTMIDIPort                         port[1];
  217. };
  218. typedef struct QTMIDIPortList            QTMIDIPortList;
  219. typedef QTMIDIPortList *                QTMIDIPortListPtr;
  220. typedef QTMIDIPortListPtr *                QTMIDIPortListHandle;
  221. EXTERN_API( ComponentResult )
  222. QTMIDIGetMIDIPorts                (QTMIDIComponent         ci,
  223.                                  QTMIDIPortListHandle *    inputPorts,
  224.                                  QTMIDIPortListHandle *    outputPorts)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x0001, 0x7000, 0xA82A);
  225.  
  226. EXTERN_API( ComponentResult )
  227. QTMIDIUseSendPort                (QTMIDIComponent         ci,
  228.                                  long                     portIndex,
  229.                                  long                     inUse)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  230.  
  231. EXTERN_API( ComponentResult )
  232. QTMIDISendMIDI                    (QTMIDIComponent         ci,
  233.                                  long                     portIndex,
  234.                                  MusicMIDIPacket *        mp)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  235.  
  236. EXTERN_API( ComponentResult )
  237. QTMIDIUseReceivePort            (QTMIDIComponent         ci,
  238.                                  long                     portIndex,
  239.                                  MusicMIDIReadHookUPP     readHook,
  240.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0004, 0x7000, 0xA82A);
  241.  
  242.  
  243.  
  244.  
  245. enum {
  246.     kMusicComponentType            = FOUR_CHAR_CODE('musi'),
  247.     kInstrumentComponentType    = FOUR_CHAR_CODE('inst')
  248. };
  249.  
  250.  
  251. enum {
  252.     kSoftSynthComponentSubType    = FOUR_CHAR_CODE('ss  '),
  253.     kGMSynthComponentSubType    = FOUR_CHAR_CODE('gm  ')
  254. };
  255.  
  256.  
  257.  
  258. typedef ComponentInstance                 MusicComponent;
  259. /* MusicSynthesizerFlags*/
  260.  
  261. enum {
  262.     kSynthesizerDynamicVoice    = 1 << 0,                        /* can assign voices on the fly (else, polyphony is very important */
  263.     kSynthesizerUsesMIDIPort    = 1 << 1,                        /* must be patched through MIDI Manager */
  264.     kSynthesizerMicrotone        = 1 << 2,                        /* can play microtonal scales */
  265.     kSynthesizerHasSamples        = 1 << 3,                        /* synthesizer has some use for sampled data */
  266.     kSynthesizerMixedDrums        = 1 << 4,                        /* any part can play drum parts, total = instrument parts */
  267.     kSynthesizerSoftware        = 1 << 5,                        /* implemented in main CPU software == uses cpu cycles */
  268.     kSynthesizerHardware        = 1 << 6,                        /* is a hardware device (such as nubus, or maybe DSP?) */
  269.     kSynthesizerDynamicChannel    = 1 << 7,                        /* can move any part to any channel or disable each part. (else we assume it lives on all channels in masks) */
  270.     kSynthesizerHogsSystemChannel = 1 << 8,                        /* can be channelwise dynamic, but always responds on its system channel */
  271.     kSynthesizerHasSystemChannel = 1 << 9,                        /* has some "system channel" notion to distinguish it from multiple instances of the same device (GM devices dont) */
  272.     kSynthesizerSlowSetPart        = 1 << 10,                        /* SetPart() and SetPartInstrumentNumber() calls do not have rapid response, may glitch notes */
  273.     kSynthesizerOffline            = 1 << 12,                        /* can enter an offline synthesis mode */
  274.     kSynthesizerGM                = 1 << 14,                        /* synth is a GM device */
  275.     kSynthesizerDLS                = 1 << 15,                        /* synth supports DLS level 1 */
  276.     kSynthesizerSoundLocalization = 1 << 16                        /* synth supports extremely baroque, nonstandard, and proprietary "apple game sprockets" localization parameter set */
  277. };
  278.  
  279. /*
  280.  * Note that these controller numbers
  281.  * are _not_ identical to the MIDI controller numbers.
  282.  * These are _signed_ 8.8 values, and the LSB's are
  283.  * always sent to a MIDI device. Controllers 32-63 are
  284.  * reserved (for MIDI, they are LSB's for 0-31, but we
  285.  * always send both).
  286.  *
  287.  * The full range, therefore, is -128.00 to 127.7f.
  288.  *
  289.  * _Excepting_ _volume_, all controls default to zero.
  290.  *
  291.  * Pitch bend is specified in fractional semitones! No
  292.  * more "pitch bend range" nonsense. You can bend as far
  293.  * as you want, any time you want.
  294.  */
  295. typedef SInt32                             MusicController;
  296.  
  297. enum {
  298.     kControllerModulationWheel    = 1,
  299.     kControllerBreath            = 2,
  300.     kControllerFoot                = 4,
  301.     kControllerPortamentoTime    = 5,                            /* time in 8.8 seconds, portamento on/off is omitted, 0 time = 'off' */
  302.     kControllerVolume            = 7,                            /* main volume control */
  303.     kControllerBalance            = 8,
  304.     kControllerPan                = 10,                            /* 0 - "default", 1 - n: positioned in output 1-n (incl fractions) */
  305.     kControllerExpression        = 11,                            /* secondary volume control */
  306.     kControllerLever1            = 16,                            /* general purpose controllers */
  307.     kControllerLever2            = 17,                            /* general purpose controllers */
  308.     kControllerLever3            = 18,                            /* general purpose controllers */
  309.     kControllerLever4            = 19,                            /* general purpose controllers */
  310.     kControllerLever5            = 80,                            /* general purpose controllers */
  311.     kControllerLever6            = 81,                            /* general purpose controllers */
  312.     kControllerLever7            = 82,                            /* general purpose controllers */
  313.     kControllerLever8            = 83,                            /* general purpose controllers */
  314.     kControllerPitchBend        = 32,                            /* positive & negative semitones, with 8 bits fraction, same units as transpose controllers*/
  315.     kControllerAfterTouch        = 33,                            /* aka channel pressure */
  316.     kControllerPartTranspose    = 40,                            /* identical to pitchbend, for overall part xpose */
  317.     kControllerTuneTranspose    = 41,                            /* another pitchbend, for "song global" pitch offset */
  318.     kControllerPartVolume        = 42,                            /* another volume control, passed right down from note allocator part volume */
  319.     kControllerTuneVolume        = 43,                            /* another volume control, used for "song global" volume - since we share one synthesizer across multiple tuneplayers*/
  320.     kControllerSustain            = 64,                            /* boolean - positive for on, 0 or negative off */
  321.     kControllerPortamento        = 65,                            /* boolean*/
  322.     kControllerSostenuto        = 66,                            /* boolean */
  323.     kControllerSoftPedal        = 67,                            /* boolean */
  324.     kControllerReverb            = 91,
  325.     kControllerTremolo            = 92,
  326.     kControllerChorus            = 93,
  327.     kControllerCeleste            = 94,
  328.     kControllerPhaser            = 95,
  329.     kControllerEditPart            = 113,                            /* last 16 controllers 113-128 and above are global controllers which respond on part zero */
  330.     kControllerMasterTune        = 114,
  331.     kControllerMasterTranspose    = 114,                            /* preferred*/
  332.     kControllerMasterVolume        = 115,
  333.     kControllerMasterCPULoad    = 116,
  334.     kControllerMasterPolyphony    = 117,
  335.     kControllerMasterFeatures    = 118
  336. };
  337.  
  338.  
  339. /* ID's of knobs supported by the QuickTime Music Synthesizer built into QuickTime*/
  340.  
  341.  
  342. enum {
  343.     kQTMSKnobStartID            = 0x02000000,
  344.     kQTMSKnobVolumeAttackTimeID    = 0x02000001,
  345.     kQTMSKnobVolumeDecayTimeID    = 0x02000002,
  346.     kQTMSKnobVolumeSustainLevelID = 0x02000003,
  347.     kQTMSKnobVolumeRelease1RateID = 0x02000004,
  348.     kQTMSKnobVolumeDecayKeyScalingID = 0x02000005,
  349.     kQTMSKnobVolumeReleaseTimeID = 0x02000006,
  350.     kQTMSKnobVolumeLFODelayID    = 0x02000007,
  351.     kQTMSKnobVolumeLFORampTimeID = 0x02000008,
  352.     kQTMSKnobVolumeLFOPeriodID    = 0x02000009,
  353.     kQTMSKnobVolumeLFOShapeID    = 0x0200000A,
  354.     kQTMSKnobVolumeLFODepthID    = 0x0200000B,
  355.     kQTMSKnobVolumeOverallID    = 0x0200000C,
  356.     kQTMSKnobVolumeVelocity127ID = 0x0200000D,
  357.     kQTMSKnobVolumeVelocity96ID    = 0x0200000E,
  358.     kQTMSKnobVolumeVelocity64ID    = 0x0200000F,
  359.     kQTMSKnobVolumeVelocity32ID    = 0x02000010,
  360.     kQTMSKnobVolumeVelocity16ID    = 0x02000011,                    /* Pitch related knobs*/
  361.     kQTMSKnobPitchTransposeID    = 0x02000012,
  362.     kQTMSKnobPitchLFODelayID    = 0x02000013,
  363.     kQTMSKnobPitchLFORampTimeID    = 0x02000014,
  364.     kQTMSKnobPitchLFOPeriodID    = 0x02000015,
  365.     kQTMSKnobPitchLFOShapeID    = 0x02000016,
  366.     kQTMSKnobPitchLFODepthID    = 0x02000017,
  367.     kQTMSKnobPitchLFOQuantizeID    = 0x02000018,                    /* Stereo related knobs*/
  368.     kQTMSKnobStereoDefaultPanID    = 0x02000019,
  369.     kQTMSKnobStereoPositionKeyScalingID = 0x0200001A,
  370.     kQTMSKnobPitchLFOOffsetID    = 0x0200001B,
  371.     kQTMSKnobExclusionGroupID    = 0x0200001C,                    /* Misc knobs, late additions*/
  372.     kQTMSKnobSustainTimeID        = 0x0200001D,
  373.     kQTMSKnobSustainInfiniteID    = 0x0200001E,
  374.     kQTMSKnobVolumeLFOStereoID    = 0x0200001F,
  375.     kQTMSKnobVelocityLowID        = 0x02000020,
  376.     kQTMSKnobVelocityHighID        = 0x02000021,
  377.     kQTMSKnobVelocitySensitivityID = 0x02000022,
  378.     kQTMSKnobPitchSensitivityID    = 0x02000023,
  379.     kQTMSKnobVolumeLFODepthFromWheelID = 0x02000024,
  380.     kQTMSKnobPitchLFODepthFromWheelID = 0x02000025,                /* Volume Env again*/
  381.     kQTMSKnobVolumeExpOptionsID    = 0x02000026,                    /* Env1*/
  382.     kQTMSKnobEnv1AttackTimeID    = 0x02000027,
  383.     kQTMSKnobEnv1DecayTimeID    = 0x02000028,
  384.     kQTMSKnobEnv1SustainLevelID    = 0x02000029,
  385.     kQTMSKnobEnv1SustainTimeID    = 0x0200002A,
  386.     kQTMSKnobEnv1SustainInfiniteID = 0x0200002B,
  387.     kQTMSKnobEnv1ReleaseTimeID    = 0x0200002C,
  388.     kQTMSKnobEnv1ExpOptionsID    = 0x0200002D,                    /* Env2*/
  389.     kQTMSKnobEnv2AttackTimeID    = 0x0200002E,
  390.     kQTMSKnobEnv2DecayTimeID    = 0x0200002F,
  391.     kQTMSKnobEnv2SustainLevelID    = 0x02000030,
  392.     kQTMSKnobEnv2SustainTimeID    = 0x02000031,
  393.     kQTMSKnobEnv2SustainInfiniteID = 0x02000032,
  394.     kQTMSKnobEnv2ReleaseTimeID    = 0x02000033,
  395.     kQTMSKnobEnv2ExpOptionsID    = 0x02000034,                    /* Pitch Env*/
  396.     kQTMSKnobPitchEnvelopeID    = 0x02000035,
  397.     kQTMSKnobPitchEnvelopeDepthID = 0x02000036,                    /* Filter*/
  398.     kQTMSKnobFilterKeyFollowID    = 0x02000037,
  399.     kQTMSKnobFilterTransposeID    = 0x02000038,
  400.     kQTMSKnobFilterQID            = 0x02000039,
  401.     kQTMSKnobFilterFrequencyEnvelopeID = 0x0200003A,
  402.     kQTMSKnobFilterFrequencyEnvelopeDepthID = 0x0200003B,
  403.     kQTMSKnobFilterQEnvelopeID    = 0x0200003C,
  404.     kQTMSKnobFilterQEnvelopeDepthID = 0x0200003D,                /* Reverb Threshhold*/
  405.     kQTMSKnobReverbThresholdID    = 0x0200003E,
  406.     kQTMSKnobVolumeAttackVelScalingID = 0x0200003F,
  407.     kQTMSKnobLastIDPlus1        = 0x02000040
  408. };
  409.  
  410.  
  411.  
  412.  
  413.  
  414. enum {
  415.     kControllerMaximum            = 0x00007FFF,                    /* +01111111.11111111 */
  416.     kControllerMinimum            = (long)0xFFFF8000                /* -10000000.00000000 */
  417. };
  418.  
  419.  
  420. struct SynthesizerDescription {
  421.     OSType                             synthesizerType;            /* synthesizer type (must be same as component subtype) */
  422.     Str31                             name;                        /* text name of synthesizer type */
  423.     unsigned long                     flags;                        /* from the above enum */
  424.     unsigned long                     voiceCount;                    /* maximum polyphony */
  425.  
  426.     unsigned long                     partCount;                    /* maximum multi-timbrality (and midi channels) */
  427.     unsigned long                     instrumentCount;            /* non gm, built in (rom) instruments only */
  428.     unsigned long                     modifiableInstrumentCount;    /* plus n-more are user modifiable */
  429.     unsigned long                     channelMask;                /* (midi device only) which channels device always uses */
  430.  
  431.     unsigned long                     drumPartCount;                /* maximum multi-timbrality of drum parts */
  432.     unsigned long                     drumCount;                    /* non gm, built in (rom) drumkits only */
  433.     unsigned long                     modifiableDrumCount;        /* plus n-more are user modifiable */
  434.     unsigned long                     drumChannelMask;            /* (midi device only) which channels device always uses */
  435.  
  436.     unsigned long                     outputCount;                /* number of audio outputs (usually two) */
  437.     unsigned long                     latency;                    /* response time in µSec */
  438.  
  439.     unsigned long                     controllers[4];                /* array of 128 bits */
  440.     unsigned long                     gmInstruments[4];            /* array of 128 bits */
  441.     unsigned long                     gmDrums[4];                    /* array of 128 bits */
  442. };
  443. typedef struct SynthesizerDescription    SynthesizerDescription;
  444.  
  445. enum {
  446.     kVoiceCountDynamic            = -1                            /* constant to use to specify dynamic voicing */
  447. };
  448.  
  449.  
  450.  
  451. struct ToneDescription {
  452.     BigEndianOSType                 synthesizerType;            /* synthesizer type */
  453.     Str31                             synthesizerName;            /* name of instantiation of synth */
  454.     Str31                             instrumentName;                /* preferred name for human use */
  455.     BigEndianLong                     instrumentNumber;            /* inst-number used if synth-name matches */
  456.     BigEndianLong                     gmNumber;                    /* Best matching general MIDI number */
  457. };
  458. typedef struct ToneDescription            ToneDescription;
  459.  
  460. enum {
  461.     kFirstGMInstrument            = 0x00000001,
  462.     kLastGMInstrument            = 0x00000080,
  463.     kFirstGSInstrument            = 0x00000081,
  464.     kLastGSInstrument            = 0x00003FFF,
  465.     kFirstDrumkit                = 0x00004000,                    /* (first value is "no drum". instrument numbers from 16384->16384+128 are drumkits, and for GM they are _defined_ drumkits! */
  466.     kLastDrumkit                = 0x00004080,
  467.     kFirstROMInstrument            = 0x00008000,
  468.     kLastROMInstrument            = 0x0000FFFF,
  469.     kFirstUserInstrument        = 0x00010000,
  470.     kLastUserInstrument            = 0x0001FFFF
  471. };
  472.  
  473. /* InstrumentMatch*/
  474.  
  475. enum {
  476.     kInstrumentMatchSynthesizerType = 1,
  477.     kInstrumentMatchSynthesizerName = 2,
  478.     kInstrumentMatchName        = 4,
  479.     kInstrumentMatchNumber        = 8,
  480.     kInstrumentMatchGMNumber    = 16,
  481.     kInstrumentMatchGSNumber    = 32
  482. };
  483.  
  484. /* KnobFlags*/
  485.  
  486. enum {
  487.     kKnobBasic                    = 8,                            /* knob shows up in certain simplified lists of knobs */
  488.     kKnobReadOnly                = 16,                            /* knob value cannot be changed by user or with a SetKnob call */
  489.     kKnobInterruptUnsafe        = 32,                            /* only alter this knob from foreground task time (may access toolbox) */
  490.     kKnobKeyrangeOverride        = 64,                            /* knob can be overridden within a single keyrange (software synth only) */
  491.     kKnobGroupStart                = 128,                            /* knob is first in some logical group of knobs */
  492.     kKnobFixedPoint8            = 1024,
  493.     kKnobFixedPoint16            = 2048,                            /* One of these may be used at a time. */
  494.     kKnobTypeNumber                = 0 << 12,
  495.     kKnobTypeGroupName            = 1 << 12,                        /* "knob" is really a group name for display purposes */
  496.     kKnobTypeBoolean            = 2 << 12,                        /* if range is greater than 1, its a multi-checkbox field */
  497.     kKnobTypeNote                = 3 << 12,                        /* knob range is equivalent to MIDI keys */
  498.     kKnobTypePan                = 4 << 12,                        /* range goes left/right (lose this? ) */
  499.     kKnobTypeInstrument            = 5 << 12,                        /* knob value = reference to another instrument number */
  500.     kKnobTypeSetting            = 6 << 12,                        /* knob value is 1 of n different things (eg, fm algorithms) popup menu */
  501.     kKnobTypeMilliseconds        = 7 << 12,                        /* knob is a millisecond time range */
  502.     kKnobTypePercentage            = 8 << 12,                        /* knob range is displayed as a Percentage */
  503.     kKnobTypeHertz                = 9 << 12,                        /* knob represents frequency */
  504.     kKnobTypeButton                = 10 << 12                        /* momentary trigger push button */
  505. };
  506.  
  507.  
  508.  
  509. enum {
  510.     kUnknownKnobValue            = 0x7FFFFFFF,                    /* a knob with this value means, we don't know it. */
  511.     kDefaultKnobValue            = 0x7FFFFFFE                    /* used to SET a knob to its default value. */
  512. };
  513.  
  514.  
  515. struct KnobDescription {
  516.     Str63                             name;
  517.     long                             lowValue;
  518.     long                             highValue;
  519.     long                             defaultValue;                /* a default instrument is made of all default values */
  520.     long                             flags;
  521.     long                             knobID;
  522. };
  523. typedef struct KnobDescription            KnobDescription;
  524.  
  525. struct GCInstrumentData {
  526.     ToneDescription                 tone;
  527.     long                             knobCount;
  528.     long                             knob[1];
  529. };
  530. typedef struct GCInstrumentData            GCInstrumentData;
  531. typedef GCInstrumentData *                GCInstrumentDataPtr;
  532. typedef GCInstrumentDataPtr *            GCInstrumentDataHandle;
  533.  
  534. struct InstrumentAboutInfo {
  535.     PicHandle                         p;
  536.     Str255                             author;
  537.     Str255                             copyright;
  538.     Str255                             other;
  539. };
  540. typedef struct InstrumentAboutInfo        InstrumentAboutInfo;
  541.  
  542.  
  543. enum {
  544.     notImplementedMusicErr        = (0x80000000 | (0xFFFF & (notImplementedMusicOSErr))),
  545.     cantSendToSynthesizerErr    = (0x80000000 | (0xFFFF & (cantSendToSynthesizerOSErr))),
  546.     cantReceiveFromSynthesizerErr = (0x80000000 | (0xFFFF & (cantReceiveFromSynthesizerOSErr))),
  547.     illegalVoiceAllocationErr    = (0x80000000 | (0xFFFF & (illegalVoiceAllocationOSErr))),
  548.     illegalPartErr                = (0x80000000 | (0xFFFF & (illegalPartOSErr))),
  549.     illegalChannelErr            = (0x80000000 | (0xFFFF & (illegalChannelOSErr))),
  550.     illegalKnobErr                = (0x80000000 | (0xFFFF & (illegalKnobOSErr))),
  551.     illegalKnobValueErr            = (0x80000000 | (0xFFFF & (illegalKnobValueOSErr))),
  552.     illegalInstrumentErr        = (0x80000000 | (0xFFFF & (illegalInstrumentOSErr))),
  553.     illegalControllerErr        = (0x80000000 | (0xFFFF & (illegalControllerOSErr))),
  554.     midiManagerAbsentErr        = (0x80000000 | (0xFFFF & (midiManagerAbsentOSErr))),
  555.     synthesizerNotRespondingErr    = (0x80000000 | (0xFFFF & (synthesizerNotRespondingOSErr))),
  556.     synthesizerErr                = (0x80000000 | (0xFFFF & (synthesizerOSErr))),
  557.     illegalNoteChannelErr        = (0x80000000 | (0xFFFF & (illegalNoteChannelOSErr))),
  558.     noteChannelNotAllocatedErr    = (0x80000000 | (0xFFFF & (noteChannelNotAllocatedOSErr))),
  559.     tunePlayerFullErr            = (0x80000000 | (0xFFFF & (tunePlayerFullOSErr))),
  560.     tuneParseErr                = (0x80000000 | (0xFFFF & (tuneParseOSErr)))
  561. };
  562.  
  563.  
  564. enum {
  565.     kGetAtomicInstNoExpandedSamples = 1 << 0,
  566.     kGetAtomicInstNoOriginalSamples = 1 << 1,
  567.     kGetAtomicInstNoSamples        = kGetAtomicInstNoExpandedSamples | kGetAtomicInstNoOriginalSamples,
  568.     kGetAtomicInstNoKnobList    = 1 << 2,
  569.     kGetAtomicInstNoInstrumentInfo = 1 << 3,
  570.     kGetAtomicInstOriginalKnobList = 1 << 4,
  571.     kGetAtomicInstAllKnobs        = 1 << 5                        /* return even those that are set to default*/
  572. };
  573.  
  574. /*
  575.    For non-gm instruments, instrument number of tone description == 0
  576.    If you want to speed up while running, slam the inst num with what Get instrument number returns
  577.    All missing knobs are slammed to the default value
  578. */
  579.  
  580. enum {
  581.     kSetAtomicInstKeepOriginalInstrument = 1 << 0,
  582.     kSetAtomicInstShareAcrossParts = 1 << 1,                    /* inst disappears when app goes away*/
  583.     kSetAtomicInstCallerTosses    = 1 << 2,                        /* the caller isn't keeping a copy around (for NASetAtomicInstrument)*/
  584.     kSetAtomicInstCallerGuarantees = 1 << 3,                    /* the caller guarantees a copy is around*/
  585.     kSetAtomicInstInterruptSafe    = 1 << 4,                        /* dont move memory at this time (but process at next task time)*/
  586.     kSetAtomicInstDontPreprocess = 1 << 7                        /* perform no further preprocessing because either 1)you know the instrument is digitally clean, or 2) you got it from a GetPartAtomic*/
  587. };
  588.  
  589.  
  590. enum {
  591.     kInstrumentNamesModifiable    = 1,
  592.     kInstrumentNamesBoth        = 2
  593. };
  594.  
  595. /*
  596.  * Structures specific to the GenericMusicComponent
  597.  */
  598.  
  599.  
  600. enum {
  601.     kGenericMusicComponentSubtype = FOUR_CHAR_CODE('gene')
  602. };
  603.  
  604.  
  605. struct GenericKnobDescription {
  606.     KnobDescription                 kd;
  607.     long                             hw1;                        /* driver defined */
  608.     long                             hw2;                        /* driver defined */
  609.     long                             hw3;                        /* driver defined */
  610.     long                             settingsID;                    /* resource ID list for boolean and popup names */
  611. };
  612. typedef struct GenericKnobDescription    GenericKnobDescription;
  613.  
  614. struct GenericKnobDescriptionList {
  615.     long                             knobCount;
  616.     GenericKnobDescription             knob[1];
  617. };
  618. typedef struct GenericKnobDescriptionList GenericKnobDescriptionList;
  619. typedef GenericKnobDescriptionList *    GenericKnobDescriptionListPtr;
  620. typedef GenericKnobDescriptionListPtr *    GenericKnobDescriptionListHandle;
  621. /* knobTypes for MusicDerivedSetKnob */
  622.  
  623. enum {
  624.     kGenericMusicKnob            = 1,
  625.     kGenericMusicInstrumentKnob    = 2,
  626.     kGenericMusicDrumKnob        = 3,
  627.     kGenericMusicGlobalController = 4
  628. };
  629.  
  630.  
  631.  
  632.  
  633. enum {
  634.     kGenericMusicResFirst        = 0,
  635.     kGenericMusicResMiscStringList = 1,                            /* STR# 1: synth name, 2:about author,3:aboutcopyright,4:aboutother */
  636.     kGenericMusicResMiscLongList = 2,                            /* Long various params, see list below */
  637.     kGenericMusicResInstrumentList = 3,                            /* NmLs of names and shorts, categories prefixed by '••' */
  638.     kGenericMusicResDrumList    = 4,                            /* NmLs of names and shorts */
  639.     kGenericMusicResInstrumentKnobDescriptionList = 5,            /* Knob */
  640.     kGenericMusicResDrumKnobDescriptionList = 6,                /* Knob */
  641.     kGenericMusicResKnobDescriptionList = 7,                    /* Knob */
  642.     kGenericMusicResBitsLongList = 8,                            /* Long back to back bitmaps of controllers, gminstruments, and drums */
  643.     kGenericMusicResModifiableInstrumentHW = 9,                    /* Shrt same as the hw shorts trailing the instrument names, a shortlist */
  644.     kGenericMusicResGMTranslation = 10,                            /* Long 128 long entries, 1 for each gm inst, of local instrument numbers 1-n (not hw numbers) */
  645.     kGenericMusicResROMInstrumentData = 11,                        /* knob lists for ROM instruments, so the knob values may be known */
  646.     kGenericMusicResAboutPICT    = 12,                            /* picture for aboutlist. must be present for GetAbout call to work */
  647.     kGenericMusicResLast        = 13
  648. };
  649.  
  650. /* elements of the misc long list */
  651.  
  652. enum {
  653.     kGenericMusicMiscLongFirst    = 0,
  654.     kGenericMusicMiscLongVoiceCount = 1,
  655.     kGenericMusicMiscLongPartCount = 2,
  656.     kGenericMusicMiscLongModifiableInstrumentCount = 3,
  657.     kGenericMusicMiscLongChannelMask = 4,
  658.     kGenericMusicMiscLongDrumPartCount = 5,
  659.     kGenericMusicMiscLongModifiableDrumCount = 6,
  660.     kGenericMusicMiscLongDrumChannelMask = 7,
  661.     kGenericMusicMiscLongOutputCount = 8,
  662.     kGenericMusicMiscLongLatency = 9,
  663.     kGenericMusicMiscLongFlags    = 10,
  664.     kGenericMusicMiscLongFirstGMHW = 11,                        /* number to add to locate GM main instruments */
  665.     kGenericMusicMiscLongFirstGMDrumHW = 12,                    /* number to add to locate GM drumkits */
  666.     kGenericMusicMiscLongFirstUserHW = 13,                        /* First hw number of user instruments (presumed sequential) */
  667.     kGenericMusicMiscLongLast    = 14
  668. };
  669.  
  670.  
  671. struct GCPart {
  672.     long                             hwInstrumentNumber;            /* internal number of recalled instrument */
  673.     short                             controller[128];            /* current values for all controllers */
  674.     long                             volume;                        /* ctrl 7 is special case */
  675.     long                             polyphony;
  676.     long                             midiChannel;                /* 1-16 if in use */
  677.     GCInstrumentData                 id;                            /* ToneDescription & knoblist, uncertain length */
  678. };
  679. typedef struct GCPart                    GCPart;
  680. /*
  681.  * Calls specific to the GenericMusicComponent
  682.  */
  683.  
  684. enum {
  685.     kMusicGenericRange            = 0x0100,
  686.     kMusicDerivedRange            = 0x0200
  687. };
  688.  
  689. /*
  690.  * Flags in GenericMusicConfigure call
  691.  */
  692.  
  693. enum {
  694.     kGenericMusicDoMIDI            = 1 << 0,                        /* implement normal MIDI messages for note, controllers, and program changes 0-127 */
  695.     kGenericMusicBank0            = 1 << 1,                        /* implement instrument bank changes on controller 0 */
  696.     kGenericMusicBank32            = 1 << 2,                        /* implement instrument bank changes on controller 32 */
  697.     kGenericMusicErsatzMIDI        = 1 << 3,                        /* construct MIDI packets, but send them to the derived component */
  698.     kGenericMusicCallKnobs        = 1 << 4,                        /* call the derived component with special knob format call */
  699.     kGenericMusicCallParts        = 1 << 5,                        /* call the derived component with special part format call */
  700.     kGenericMusicCallInstrument    = 1 << 6,                        /* call MusicDerivedSetInstrument for MusicSetInstrument calls */
  701.     kGenericMusicCallNumber        = 1 << 7,                        /* call MusicDerivedSetPartInstrumentNumber for MusicSetPartInstrumentNumber calls, & don't send any C0 or bank stuff */
  702.     kGenericMusicCallROMInstrument = 1 << 8,                    /* call MusicSetInstrument for MusicSetPartInstrumentNumber for "ROM" instruments, passing params from the ROMi resource */
  703.     kGenericMusicAllDefaults    = 1 << 9                        /* indicates that when a new instrument is recalled, all knobs are reset to DEFAULT settings. True for GS modules */
  704. };
  705.  
  706.  
  707.  
  708.  
  709.  
  710. typedef CALLBACK_API( ComponentResult , MusicOfflineDataProcPtr )(Ptr SoundData, long numBytes, long myRefCon);
  711. typedef STACK_UPP_TYPE(MusicOfflineDataProcPtr)                 MusicOfflineDataUPP;
  712.  
  713. struct OfflineSampleType {
  714.     unsigned long                     numChannels;                /*number of channels,  ie mono = 1*/
  715.     UnsignedFixed                     sampleRate;                    /*sample rate in Apples Fixed point representation*/
  716.     unsigned short                     sampleSize;                    /*number of bits in sample*/
  717. };
  718. typedef struct OfflineSampleType        OfflineSampleType;
  719.  
  720. struct InstrumentInfoRecord {
  721.     long                             instrumentNumber;            /* instrument number (if 0, name is a catagory)*/
  722.     long                             flags;                        /* show in picker, etc.*/
  723.     long                             toneNameIndex;                /* index in toneNames (1 based)*/
  724.     long                             itxtNameAtomID;                /* index in itxtNames (itxt/name by index)*/
  725. };
  726. typedef struct InstrumentInfoRecord        InstrumentInfoRecord;
  727.  
  728. struct InstrumentInfoList {
  729.     long                             recordCount;
  730.     Handle                             toneNames;                    /* name from tone description*/
  731.     QTAtomContainer                 itxtNames;                    /* itxt/name atoms for instruments*/
  732.     InstrumentInfoRecord             info[1];
  733. };
  734. typedef struct InstrumentInfoList        InstrumentInfoList;
  735. typedef InstrumentInfoList *            InstrumentInfoListPtr;
  736. typedef InstrumentInfoListPtr *            InstrumentInfoListHandle;
  737. EXTERN_API( ComponentResult )
  738. MusicGetDescription                (MusicComponent         mc,
  739.                                  SynthesizerDescription * sd)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  740.  
  741. EXTERN_API( ComponentResult )
  742. MusicGetPart                    (MusicComponent         mc,
  743.                                  long                     part,
  744.                                  long *                    midiChannel,
  745.                                  long *                    polyphony)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0002, 0x7000, 0xA82A);
  746.  
  747. EXTERN_API( ComponentResult )
  748. MusicSetPart                    (MusicComponent         mc,
  749.                                  long                     part,
  750.                                  long                     midiChannel,
  751.                                  long                     polyphony)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0003, 0x7000, 0xA82A);
  752.  
  753. EXTERN_API( ComponentResult )
  754. MusicSetPartInstrumentNumber    (MusicComponent         mc,
  755.                                  long                     part,
  756.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  757.  
  758. #if OLDROUTINENAMES
  759. #define MusicSetInstrumentNumber(ci,part,instrumentNumber) MusicSetPartInstrumentNumber(ci, part,instrumentNumber)
  760. #endif
  761.  
  762. EXTERN_API( ComponentResult )
  763. MusicGetPartInstrumentNumber    (MusicComponent         mc,
  764.                                  long                     part)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  765.  
  766. EXTERN_API( ComponentResult )
  767. MusicStorePartInstrument        (MusicComponent         mc,
  768.                                  long                     part,
  769.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0006, 0x7000, 0xA82A);
  770.  
  771.  
  772. EXTERN_API( ComponentResult )
  773. MusicGetPartAtomicInstrument    (MusicComponent         mc,
  774.                                  long                     part,
  775.                                  AtomicInstrument *        ai,
  776.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0009, 0x7000, 0xA82A);
  777.  
  778. EXTERN_API( ComponentResult )
  779. MusicSetPartAtomicInstrument    (MusicComponent         mc,
  780.                                  long                     part,
  781.                                  AtomicInstrumentPtr     aiP,
  782.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x000A, 0x7000, 0xA82A);
  783.  
  784.  
  785. /* Obsolete calls*/
  786. EXTERN_API( ComponentResult )
  787. MusicGetInstrumentKnobDescriptionObsolete (MusicComponent  mc,
  788.                                  long                     knobIndex,
  789.                                  void *                    mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000D, 0x7000, 0xA82A);
  790.  
  791. EXTERN_API( ComponentResult )
  792. MusicGetDrumKnobDescriptionObsolete (MusicComponent     mc,
  793.                                  long                     knobIndex,
  794.                                  void *                    mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000E, 0x7000, 0xA82A);
  795.  
  796. EXTERN_API( ComponentResult )
  797. MusicGetKnobDescriptionObsolete    (MusicComponent         mc,
  798.                                  long                     knobIndex,
  799.                                  void *                    mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000F, 0x7000, 0xA82A);
  800.  
  801. EXTERN_API( ComponentResult )
  802. MusicGetPartKnob                (MusicComponent         mc,
  803.                                  long                     part,
  804.                                  long                     knobID)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0010, 0x7000, 0xA82A);
  805.  
  806. EXTERN_API( ComponentResult )
  807. MusicSetPartKnob                (MusicComponent         mc,
  808.                                  long                     part,
  809.                                  long                     knobID,
  810.                                  long                     knobValue)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0011, 0x7000, 0xA82A);
  811.  
  812. EXTERN_API( ComponentResult )
  813. MusicGetKnob                    (MusicComponent         mc,
  814.                                  long                     knobID)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0012, 0x7000, 0xA82A);
  815.  
  816. EXTERN_API( ComponentResult )
  817. MusicSetKnob                    (MusicComponent         mc,
  818.                                  long                     knobID,
  819.                                  long                     knobValue)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0013, 0x7000, 0xA82A);
  820.  
  821. EXTERN_API( ComponentResult )
  822. MusicGetPartName                (MusicComponent         mc,
  823.                                  long                     part,
  824.                                  StringPtr                 name)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0014, 0x7000, 0xA82A);
  825.  
  826. EXTERN_API( ComponentResult )
  827. MusicSetPartName                (MusicComponent         mc,
  828.                                  long                     part,
  829.                                  StringPtr                 name)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0015, 0x7000, 0xA82A);
  830.  
  831. EXTERN_API( ComponentResult )
  832. MusicFindTone                    (MusicComponent         mc,
  833.                                  ToneDescription *        td,
  834.                                  long *                    libraryIndexOut,
  835.                                  unsigned long *        fit)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0016, 0x7000, 0xA82A);
  836.  
  837. EXTERN_API( ComponentResult )
  838. MusicPlayNote                    (MusicComponent         mc,
  839.                                  long                     part,
  840.                                  long                     pitch,
  841.                                  long                     velocity)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0017, 0x7000, 0xA82A);
  842.  
  843. EXTERN_API( ComponentResult )
  844. MusicResetPart                    (MusicComponent         mc,
  845.                                  long                     part)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  846.  
  847. EXTERN_API( ComponentResult )
  848. MusicSetPartController            (MusicComponent         mc,
  849.                                  long                     part,
  850.                                  MusicController         controllerNumber,
  851.                                  long                     controllerValue)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  852.  
  853. #if OLDROUTINENAMES
  854. #define MusicSetController(ci,part,controllerNumber,controllerValue) MusicSetPartController(ci, part,controllerNumber,controllerValue)
  855. #endif
  856.  
  857. EXTERN_API( ComponentResult )
  858. MusicGetPartController            (MusicComponent         mc,
  859.                                  long                     part,
  860.                                  MusicController         controllerNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x001A, 0x7000, 0xA82A);
  861.  
  862. EXTERN_API( ComponentResult )
  863. MusicGetMIDIProc                (MusicComponent         mc,
  864.                                  MusicMIDISendUPP *        midiSendProc,
  865.                                  long *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  866.  
  867. EXTERN_API( ComponentResult )
  868. MusicSetMIDIProc                (MusicComponent         mc,
  869.                                  MusicMIDISendUPP         midiSendProc,
  870.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  871.  
  872. EXTERN_API( ComponentResult )
  873. MusicGetInstrumentNames            (MusicComponent         mc,
  874.                                  long                     modifiableInstruments,
  875.                                  Handle *                instrumentNames,
  876.                                  Handle *                instrumentCategoryLasts,
  877.                                  Handle *                instrumentCategoryNames)            FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  878.  
  879. EXTERN_API( ComponentResult )
  880. MusicGetDrumNames                (MusicComponent         mc,
  881.                                  long                     modifiableInstruments,
  882.                                  Handle *                instrumentNumbers,
  883.                                  Handle *                instrumentNames)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x001E, 0x7000, 0xA82A);
  884.  
  885. EXTERN_API( ComponentResult )
  886. MusicGetMasterTune                (MusicComponent         mc)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x001F, 0x7000, 0xA82A);
  887.  
  888. EXTERN_API( ComponentResult )
  889. MusicSetMasterTune                (MusicComponent         mc,
  890.                                  long                     masterTune)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0020, 0x7000, 0xA82A);
  891.  
  892.  
  893. EXTERN_API( ComponentResult )
  894. MusicGetInstrumentAboutInfo        (MusicComponent         mc,
  895.                                  long                     part,
  896.                                  InstrumentAboutInfo *    iai)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  897.  
  898. EXTERN_API( ComponentResult )
  899. MusicGetDeviceConnection        (MusicComponent         mc,
  900.                                  long                     index,
  901.                                  long *                    id1,
  902.                                  long *                    id2)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0023, 0x7000, 0xA82A);
  903.  
  904. EXTERN_API( ComponentResult )
  905. MusicUseDeviceConnection        (MusicComponent         mc,
  906.                                  long                     id1,
  907.                                  long                     id2)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0024, 0x7000, 0xA82A);
  908.  
  909. EXTERN_API( ComponentResult )
  910. MusicGetKnobSettingStrings        (MusicComponent         mc,
  911.                                  long                     knobIndex,
  912.                                  long                     isGlobal,
  913.                                  Handle *                settingsNames,
  914.                                  Handle *                settingsCategoryLasts,
  915.                                  Handle *                settingsCategoryNames)                FIVEWORDINLINE(0x2F3C, 0x0014, 0x0025, 0x7000, 0xA82A);
  916.  
  917. EXTERN_API( ComponentResult )
  918. MusicGetMIDIPorts                (MusicComponent         mc,
  919.                                  long *                    inputPortCount,
  920.                                  long *                    outputPortCount)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0026, 0x7000, 0xA82A);
  921.  
  922. EXTERN_API( ComponentResult )
  923. MusicSendMIDI                    (MusicComponent         mc,
  924.                                  long                     portIndex,
  925.                                  MusicMIDIPacket *        mp)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0027, 0x7000, 0xA82A);
  926.  
  927. EXTERN_API( ComponentResult )
  928. MusicReceiveMIDI                (MusicComponent         mc,
  929.                                  MusicMIDIReadHookUPP     readHook,
  930.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0028, 0x7000, 0xA82A);
  931.  
  932. EXTERN_API( ComponentResult )
  933. MusicStartOffline                (MusicComponent         mc,
  934.                                  unsigned long *        numChannels,
  935.                                  UnsignedFixed *        sampleRate,
  936.                                  unsigned short *        sampleSize,
  937.                                  MusicOfflineDataUPP     dataProc,
  938.                                  long                     dataProcRefCon)                        FIVEWORDINLINE(0x2F3C, 0x0014, 0x0029, 0x7000, 0xA82A);
  939.  
  940. EXTERN_API( ComponentResult )
  941. MusicSetOfflineTimeTo            (MusicComponent         mc,
  942.                                  long                     newTimeStamp)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x002A, 0x7000, 0xA82A);
  943.  
  944. EXTERN_API( ComponentResult )
  945. MusicGetInstrumentKnobDescription (MusicComponent         mc,
  946.                                  long                     knobIndex,
  947.                                  KnobDescription *        mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  948.  
  949. EXTERN_API( ComponentResult )
  950. MusicGetDrumKnobDescription        (MusicComponent         mc,
  951.                                  long                     knobIndex,
  952.                                  KnobDescription *        mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  953.  
  954. EXTERN_API( ComponentResult )
  955. MusicGetKnobDescription            (MusicComponent         mc,
  956.                                  long                     knobIndex,
  957.                                  KnobDescription *        mkd)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002D, 0x7000, 0xA82A);
  958.  
  959. EXTERN_API( ComponentResult )
  960. MusicGetInfoText                (MusicComponent         mc,
  961.                                  long                     selector,
  962.                                  Handle *                textH,
  963.                                  Handle *                styleH)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x002E, 0x7000, 0xA82A);
  964.  
  965.  
  966. enum {
  967.     kGetInstrumentInfoNoBuiltIn    = 1 << 0,
  968.     kGetInstrumentInfoMidiUserInst = 1 << 1,
  969.     kGetInstrumentInfoNoIText    = 1 << 2
  970. };
  971.  
  972. EXTERN_API( ComponentResult )
  973. MusicGetInstrumentInfo            (MusicComponent         mc,
  974.                                  long                     getInstrumentInfoFlags,
  975.                                  InstrumentInfoListHandle * infoListH)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x002F, 0x7000, 0xA82A);
  976.  
  977.  
  978.  
  979.  
  980. EXTERN_API( ComponentResult )
  981. MusicTask                        (MusicComponent         mc)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0031, 0x7000, 0xA82A);
  982.  
  983. EXTERN_API( ComponentResult )
  984. MusicSetPartInstrumentNumberInterruptSafe (MusicComponent  mc,
  985.                                  long                     part,
  986.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0032, 0x7000, 0xA82A);
  987.  
  988. EXTERN_API( ComponentResult )
  989. MusicSetPartSoundLocalization    (MusicComponent         mc,
  990.                                  long                     part,
  991.                                  Handle                 data)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0033, 0x7000, 0xA82A);
  992.  
  993. EXTERN_API( ComponentResult )
  994. MusicGenericConfigure            (MusicComponent         mc,
  995.                                  long                     mode,
  996.                                  long                     flags,
  997.                                  long                     baseResID)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0100, 0x7000, 0xA82A);
  998.  
  999. EXTERN_API( ComponentResult )
  1000. MusicGenericGetPart                (MusicComponent         mc,
  1001.                                  long                     partNumber,
  1002.                                  GCPart **                part)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0101, 0x7000, 0xA82A);
  1003.  
  1004. EXTERN_API( ComponentResult )
  1005. MusicGenericGetKnobList            (MusicComponent         mc,
  1006.                                  long                     knobType,
  1007.                                  GenericKnobDescriptionListHandle * gkdlH)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0102, 0x7000, 0xA82A);
  1008.  
  1009. EXTERN_API( ComponentResult )
  1010. MusicGenericSetResourceNumbers    (MusicComponent         mc,
  1011.                                  Handle                 resourceIDH)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0103, 0x7000, 0xA82A);
  1012.  
  1013. EXTERN_API( ComponentResult )
  1014. MusicDerivedMIDISend            (MusicComponent         mc,
  1015.                                  MusicMIDIPacket *        packet)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0200, 0x7000, 0xA82A);
  1016.  
  1017. EXTERN_API( ComponentResult )
  1018. MusicDerivedSetKnob                (MusicComponent         mc,
  1019.                                  long                     knobType,
  1020.                                  long                     knobNumber,
  1021.                                  long                     knobValue,
  1022.                                  long                     partNumber,
  1023.                                  GCPart *                p,
  1024.                                  GenericKnobDescription * gkd)                                FIVEWORDINLINE(0x2F3C, 0x0018, 0x0201, 0x7000, 0xA82A);
  1025.  
  1026. EXTERN_API( ComponentResult )
  1027. MusicDerivedSetPart                (MusicComponent         mc,
  1028.                                  long                     partNumber,
  1029.                                  GCPart *                p)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0202, 0x7000, 0xA82A);
  1030.  
  1031. EXTERN_API( ComponentResult )
  1032. MusicDerivedSetInstrument        (MusicComponent         mc,
  1033.                                  long                     partNumber,
  1034.                                  GCPart *                p)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0203, 0x7000, 0xA82A);
  1035.  
  1036. EXTERN_API( ComponentResult )
  1037. MusicDerivedSetPartInstrumentNumber (MusicComponent     mc,
  1038.                                  long                     partNumber,
  1039.                                  GCPart *                p)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0204, 0x7000, 0xA82A);
  1040.  
  1041. EXTERN_API( ComponentResult )
  1042. MusicDerivedSetMIDI                (MusicComponent         mc,
  1043.                                  MusicMIDISendUPP         midiProc,
  1044.                                  long                     refcon,
  1045.                                  long                     midiChannel)                        FIVEWORDINLINE(0x2F3C, 0x000C, 0x0205, 0x7000, 0xA82A);
  1046.  
  1047. EXTERN_API( ComponentResult )
  1048. MusicDerivedStorePartInstrument    (MusicComponent         mc,
  1049.                                  long                     partNumber,
  1050.                                  GCPart *                p,
  1051.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x0206, 0x7000, 0xA82A);
  1052.  
  1053. EXTERN_API( ComponentResult )
  1054. MusicDerivedOpenResFile            (MusicComponent         mc)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0207, 0x7000, 0xA82A);
  1055.  
  1056. EXTERN_API( ComponentResult )
  1057. MusicDerivedCloseResFile        (MusicComponent         mc,
  1058.                                  short                     resRefNum)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0x0208, 0x7000, 0xA82A);
  1059.  
  1060.  
  1061.  
  1062.  
  1063.  
  1064.  
  1065. /* Mask bit for returned value by InstrumentFind.*/
  1066.  
  1067. enum {
  1068.     kInstrumentExactMatch        = 0x00020000,
  1069.     kInstrumentRecommendedSubstitute = 0x00010000,
  1070.     kInstrumentQualityField        = (long)0xFF000000,
  1071.     kInstrumentRoland8BitQuality = 0x05000000
  1072. };
  1073.  
  1074.  
  1075. typedef InstrumentAboutInfo *            InstrumentAboutInfoPtr;
  1076. typedef InstrumentAboutInfoPtr *        InstrumentAboutInfoHandle;
  1077.  
  1078. struct GMInstrumentInfo {
  1079.     long                             cmpInstID;
  1080.     long                             gmInstNum;
  1081.     long                             instMatch;
  1082. };
  1083. typedef struct GMInstrumentInfo            GMInstrumentInfo;
  1084. typedef GMInstrumentInfo *                GMInstrumentInfoPtr;
  1085. typedef GMInstrumentInfoPtr *            GMInstrumentInfoHandle;
  1086.  
  1087. struct nonGMInstrumentInfoRecord {
  1088.     long                             cmpInstID;                    /* if 0, category name*/
  1089.     long                             flags;                        /* match, show in picker*/
  1090.     long                             toneNameIndex;                /* index in toneNames (1 based)*/
  1091.     long                             itxtNameAtomID;                /* index in itxtNames (itxt/name by index)*/
  1092. };
  1093. typedef struct nonGMInstrumentInfoRecord nonGMInstrumentInfoRecord;
  1094.  
  1095. struct nonGMInstrumentInfo {
  1096.     long                             recordCount;
  1097.     Handle                             toneNames;                    /* name from tone description*/
  1098.     QTAtomContainer                 itxtNames;                    /* itext/name atoms for instruments*/
  1099.     nonGMInstrumentInfoRecord         instInfo[1];
  1100. };
  1101. typedef struct nonGMInstrumentInfo        nonGMInstrumentInfo;
  1102. typedef nonGMInstrumentInfo *            nonGMInstrumentInfoPtr;
  1103. typedef nonGMInstrumentInfoPtr *        nonGMInstrumentInfoHandle;
  1104.  
  1105. struct InstCompInfo {
  1106.     long                             infoSize;                    /* size of this record*/
  1107.     Str31                             InstrumentLibraryName;
  1108.     QTAtomContainer                 InstrumentLibraryITxt;        /* itext/name atoms for instruments*/
  1109.     long                             GMinstrumentCount;
  1110.     GMInstrumentInfoHandle             GMinstrumentInfo;
  1111.     long                             GMdrumCount;
  1112.     GMInstrumentInfoHandle             GMdrumInfo;
  1113.     long                             nonGMinstrumentCount;
  1114.     nonGMInstrumentInfoHandle         nonGMinstrumentInfo;
  1115. };
  1116. typedef struct InstCompInfo                InstCompInfo;
  1117. typedef InstCompInfo *                    InstCompInfoPtr;
  1118. typedef InstCompInfoPtr *                InstCompInfoHandle;
  1119. EXTERN_API( ComponentResult )
  1120. InstrumentGetInst                (ComponentInstance         ci,
  1121.                                  long                     instID,
  1122.                                  AtomicInstrument *        atomicInst,
  1123.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0001, 0x7000, 0xA82A);
  1124.  
  1125. EXTERN_API( ComponentResult )
  1126. InstrumentGetInfo                (ComponentInstance         ci,
  1127.                                  long                     getInstrumentInfoFlags,
  1128.                                  InstCompInfoHandle *    instInfo)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0002, 0x7000, 0xA82A);
  1129.  
  1130. EXTERN_API( ComponentResult )
  1131. InstrumentInitialize            (ComponentInstance         ci,
  1132.                                  long                     initFormat,
  1133.                                  void *                    initParams)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0003, 0x7000, 0xA82A);
  1134.  
  1135. EXTERN_API( ComponentResult )
  1136. InstrumentOpenComponentResFile    (ComponentInstance         ci,
  1137.                                  short *                resFile)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  1138.  
  1139. EXTERN_API( ComponentResult )
  1140. InstrumentCloseComponentResFile    (ComponentInstance         ci,
  1141.                                  short                     resFile)                            FIVEWORDINLINE(0x2F3C, 0x0002, 0x0005, 0x7000, 0xA82A);
  1142.  
  1143. EXTERN_API( ComponentResult )
  1144. InstrumentGetComponentRefCon    (ComponentInstance         ci,
  1145.                                  void **                refCon)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  1146.  
  1147. EXTERN_API( ComponentResult )
  1148. InstrumentSetComponentRefCon    (ComponentInstance         ci,
  1149.                                  void *                    refCon)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1150.  
  1151. EXTERN_API( ComponentResult )
  1152. InstrumentGetSynthesizerType    (ComponentInstance         ci,
  1153.                                  OSType *                synthesizerType)                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  1154.  
  1155.  
  1156.  
  1157. /*--------------------------
  1158.     Types
  1159. --------------------------*/
  1160.  
  1161. enum {
  1162.     kNoteRequestNoGM            = 1,                            /* dont degrade to a GM synth */
  1163.     kNoteRequestNoSynthType        = 2,                            /* dont degrade to another synth of same type but different name */
  1164.     kNoteRequestSynthMustMatch    = 4                                /* synthType must be a match, including kGMSynthComponentSubType */
  1165. };
  1166.  
  1167.  
  1168. typedef ComponentInstance                 NoteAllocator;
  1169.  
  1170. struct NoteRequestInfo {
  1171.     UInt8                             flags;                        /* 1: dont accept GM match, 2: dont accept same-synth-type match */
  1172.     UInt8                             reserved;                    /* must be zero */
  1173.     BigEndianShort                     polyphony;                    /* Maximum number of voices */
  1174.     BigEndianFixed                     typicalPolyphony;            /* Hint for level mixing */
  1175. };
  1176. typedef struct NoteRequestInfo            NoteRequestInfo;
  1177.  
  1178. struct NoteRequest {
  1179.     NoteRequestInfo                 info;
  1180.     ToneDescription                 tone;
  1181. };
  1182. typedef struct NoteRequest                NoteRequest;
  1183. typedef struct OpaqueNoteChannel*         NoteChannel;
  1184.  
  1185.  
  1186.  
  1187. enum {
  1188.     kPickDontMix                = 1,                            /* dont mix instruments with drum sounds */
  1189.     kPickSameSynth                = 2,                            /* only allow the same device that went in, to come out */
  1190.     kPickUserInsts                = 4,                            /* show user insts in addition to ROM voices */
  1191.     kPickEditAllowEdit            = 8,                            /* lets user switch over to edit mode */
  1192.     kPickEditAllowPick            = 16,                            /* lets the user switch over to pick mode */
  1193.     kPickEditSynthGlobal        = 32,                            /* edit the global knobs of the synth */
  1194.     kPickEditControllers        = 64                            /* edit the controllers of the notechannel */
  1195. };
  1196.  
  1197.  
  1198.  
  1199. enum {
  1200.     kNoteAllocatorComponentType    = FOUR_CHAR_CODE('nota')
  1201. };
  1202.  
  1203.  
  1204. /*--------------------------------
  1205.     Note Allocator Prototypes
  1206. --------------------------------*/
  1207. EXTERN_API( ComponentResult )
  1208. NARegisterMusicDevice            (NoteAllocator             na,
  1209.                                  OSType                 synthType,
  1210.                                  Str31                     name,
  1211.                                  SynthesizerConnections * connections)                        FIVEWORDINLINE(0x2F3C, 0x000C, 0x0000, 0x7000, 0xA82A);
  1212.  
  1213. EXTERN_API( ComponentResult )
  1214. NAUnregisterMusicDevice            (NoteAllocator             na,
  1215.                                  long                     index)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0001, 0x7000, 0xA82A);
  1216.  
  1217. EXTERN_API( ComponentResult )
  1218. NAGetRegisteredMusicDevice        (NoteAllocator             na,
  1219.                                  long                     index,
  1220.                                  OSType *                synthType,
  1221.                                  Str31                     name,
  1222.                                  SynthesizerConnections * connections,
  1223.                                  MusicComponent *        mc)                                    FIVEWORDINLINE(0x2F3C, 0x0014, 0x0002, 0x7000, 0xA82A);
  1224.  
  1225. EXTERN_API( ComponentResult )
  1226. NASaveMusicConfiguration        (NoteAllocator             na)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0003, 0x7000, 0xA82A);
  1227.  
  1228. EXTERN_API( ComponentResult )
  1229. NANewNoteChannel                (NoteAllocator             na,
  1230.                                  NoteRequest *            noteRequest,
  1231.                                  NoteChannel *            outChannel)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x0004, 0x7000, 0xA82A);
  1232.  
  1233. EXTERN_API( ComponentResult )
  1234. NADisposeNoteChannel            (NoteAllocator             na,
  1235.                                  NoteChannel             noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1236.  
  1237. EXTERN_API( ComponentResult )
  1238. NAGetNoteChannelInfo            (NoteAllocator             na,
  1239.                                  NoteChannel             noteChannel,
  1240.                                  long *                    index,
  1241.                                  long *                    part)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0006, 0x7000, 0xA82A);
  1242.  
  1243. EXTERN_API( ComponentResult )
  1244. NAPrerollNoteChannel            (NoteAllocator             na,
  1245.                                  NoteChannel             noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1246.  
  1247. EXTERN_API( ComponentResult )
  1248. NAUnrollNoteChannel                (NoteAllocator             na,
  1249.                                  NoteChannel             noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x0008, 0x7000, 0xA82A);
  1250.  
  1251.  
  1252. EXTERN_API( ComponentResult )
  1253. NASetNoteChannelVolume            (NoteAllocator             na,
  1254.                                  NoteChannel             noteChannel,
  1255.                                  Fixed                     volume)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  1256.  
  1257. EXTERN_API( ComponentResult )
  1258. NAResetNoteChannel                (NoteAllocator             na,
  1259.                                  NoteChannel             noteChannel)                        FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1260.  
  1261. EXTERN_API( ComponentResult )
  1262. NAPlayNote                        (NoteAllocator             na,
  1263.                                  NoteChannel             noteChannel,
  1264.                                  long                     pitch,
  1265.                                  long                     velocity)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x000D, 0x7000, 0xA82A);
  1266.  
  1267. EXTERN_API( ComponentResult )
  1268. NASetController                    (NoteAllocator             na,
  1269.                                  NoteChannel             noteChannel,
  1270.                                  long                     controllerNumber,
  1271.                                  long                     controllerValue)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x000E, 0x7000, 0xA82A);
  1272.  
  1273. EXTERN_API( ComponentResult )
  1274. NASetKnob                        (NoteAllocator             na,
  1275.                                  NoteChannel             noteChannel,
  1276.                                  long                     knobNumber,
  1277.                                  long                     knobValue)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x000F, 0x7000, 0xA82A);
  1278.  
  1279. EXTERN_API( ComponentResult )
  1280. NAFindNoteChannelTone            (NoteAllocator             na,
  1281.                                  NoteChannel             noteChannel,
  1282.                                  ToneDescription *        td,
  1283.                                  long *                    instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x0010, 0x7000, 0xA82A);
  1284.  
  1285. EXTERN_API( ComponentResult )
  1286. NASetInstrumentNumber            (NoteAllocator             na,
  1287.                                  NoteChannel             noteChannel,
  1288.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0011, 0x7000, 0xA82A);
  1289.  
  1290.  
  1291.  
  1292. #if OLDROUTINENAMES
  1293. #define NASetNoteChannelInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  1294. #define NASetInstrument(ci, noteChannel,instrumentNumber ) NASetInstrumentNumber(ci, noteChannel,instrumentNumber)
  1295. #endif
  1296. EXTERN_API( ComponentResult )
  1297. NAPickInstrument                (NoteAllocator             na,
  1298.                                  ModalFilterUPP         filterProc,
  1299.                                  StringPtr                 prompt,
  1300.                                  ToneDescription *        sd,
  1301.                                  unsigned long             flags,
  1302.                                  long                     refCon,
  1303.                                  long                     reserved1,
  1304.                                  long                     reserved2)                            FIVEWORDINLINE(0x2F3C, 0x001C, 0x0012, 0x7000, 0xA82A);
  1305.  
  1306. EXTERN_API( ComponentResult )
  1307. NAPickArrangement                (NoteAllocator             na,
  1308.                                  ModalFilterUPP         filterProc,
  1309.                                  StringPtr                 prompt,
  1310.                                  long                     zero1,
  1311.                                  long                     zero2,
  1312.                                  Track                     t,
  1313.                                  StringPtr                 songName)                            FIVEWORDINLINE(0x2F3C, 0x0018, 0x0013, 0x7000, 0xA82A);
  1314.  
  1315.  
  1316. EXTERN_API( ComponentResult )
  1317. NASetDefaultMIDIInput            (NoteAllocator             na,
  1318.                                  SynthesizerConnections * sc)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0015, 0x7000, 0xA82A);
  1319.  
  1320. EXTERN_API( ComponentResult )
  1321. NAGetDefaultMIDIInput            (NoteAllocator             na,
  1322.                                  SynthesizerConnections * sc)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0016, 0x7000, 0xA82A);
  1323.  
  1324.  
  1325. EXTERN_API( ComponentResult )
  1326. NAUseDefaultMIDIInput            (NoteAllocator             na,
  1327.                                  MusicMIDIReadHookUPP     readHook,
  1328.                                  long                     refCon,
  1329.                                  unsigned long             flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0019, 0x7000, 0xA82A);
  1330.  
  1331. EXTERN_API( ComponentResult )
  1332. NALoseDefaultMIDIInput            (NoteAllocator             na)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x001A, 0x7000, 0xA82A);
  1333.  
  1334. EXTERN_API( ComponentResult )
  1335. NAStuffToneDescription            (NoteAllocator             na,
  1336.                                  long                     gmNumber,
  1337.                                  ToneDescription *        td)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x001B, 0x7000, 0xA82A);
  1338.  
  1339. EXTERN_API( ComponentResult )
  1340. NACopyrightDialog                (NoteAllocator             na,
  1341.                                  PicHandle                 p,
  1342.                                  StringPtr                 author,
  1343.                                  StringPtr                 copyright,
  1344.                                  StringPtr                 other,
  1345.                                  StringPtr                 title,
  1346.                                  ModalFilterUPP         filterProc,
  1347.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x001C, 0x001C, 0x7000, 0xA82A);
  1348.  
  1349.  
  1350. /*
  1351.       kNADummyOneSelect = 29
  1352.       kNADummyTwoSelect = 30
  1353. */
  1354.  
  1355. EXTERN_API( ComponentResult )
  1356. NAGetIndNoteChannel                (NoteAllocator             na,
  1357.                                  long                     index,
  1358.                                  NoteChannel *            nc,
  1359.                                  long *                    seed)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x001F, 0x7000, 0xA82A);
  1360.  
  1361.  
  1362. EXTERN_API( ComponentResult )
  1363. NAGetMIDIPorts                    (NoteAllocator             na,
  1364.                                  QTMIDIPortListHandle *    inputPorts,
  1365.                                  QTMIDIPortListHandle *    outputPorts)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x0021, 0x7000, 0xA82A);
  1366.  
  1367. EXTERN_API( ComponentResult )
  1368. NAGetNoteRequest                (NoteAllocator             na,
  1369.                                  NoteChannel             noteChannel,
  1370.                                  NoteRequest *            nrOut)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x0022, 0x7000, 0xA82A);
  1371.  
  1372. EXTERN_API( ComponentResult )
  1373. NASendMIDI                        (NoteAllocator             na,
  1374.                                  NoteChannel             noteChannel,
  1375.                                  MusicMIDIPacket *        mp)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0023, 0x7000, 0xA82A);
  1376.  
  1377. EXTERN_API( ComponentResult )
  1378. NAPickEditInstrument            (NoteAllocator             na,
  1379.                                  ModalFilterUPP         filterProc,
  1380.                                  StringPtr                 prompt,
  1381.                                  long                     refCon,
  1382.                                  NoteChannel             nc,
  1383.                                  AtomicInstrument         ai,
  1384.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x0018, 0x0024, 0x7000, 0xA82A);
  1385.  
  1386. EXTERN_API( ComponentResult )
  1387. NANewNoteChannelFromAtomicInstrument (NoteAllocator     na,
  1388.                                  AtomicInstrumentPtr     instrument,
  1389.                                  long                     flags,
  1390.                                  NoteChannel *            outChannel)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0025, 0x7000, 0xA82A);
  1391.  
  1392. EXTERN_API( ComponentResult )
  1393. NASetAtomicInstrument            (NoteAllocator             na,
  1394.                                  NoteChannel             noteChannel,
  1395.                                  AtomicInstrumentPtr     instrument,
  1396.                                  long                     flags)                                FIVEWORDINLINE(0x2F3C, 0x000C, 0x0026, 0x7000, 0xA82A);
  1397.  
  1398.  
  1399.  
  1400. EXTERN_API( ComponentResult )
  1401. NAGetKnob                        (NoteAllocator             na,
  1402.                                  NoteChannel             noteChannel,
  1403.                                  long                     knobNumber,
  1404.                                  long *                    knobValue)                            FIVEWORDINLINE(0x2F3C, 0x000C, 0x0028, 0x7000, 0xA82A);
  1405.  
  1406. EXTERN_API( ComponentResult )
  1407. NATask                            (NoteAllocator             na)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0029, 0x7000, 0xA82A);
  1408.  
  1409. EXTERN_API( ComponentResult )
  1410. NASetNoteChannelBalance            (NoteAllocator             na,
  1411.                                  NoteChannel             noteChannel,
  1412.                                  long                     balance)                            FIVEWORDINLINE(0x2F3C, 0x0008, 0x002A, 0x7000, 0xA82A);
  1413.  
  1414. EXTERN_API( ComponentResult )
  1415. NASetInstrumentNumberInterruptSafe (NoteAllocator         na,
  1416.                                  NoteChannel             noteChannel,
  1417.                                  long                     instrumentNumber)                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x002B, 0x7000, 0xA82A);
  1418.  
  1419. EXTERN_API( ComponentResult )
  1420. NASetNoteChannelSoundLocalization (NoteAllocator         na,
  1421.                                  NoteChannel             noteChannel,
  1422.                                  Handle                 data)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x002C, 0x7000, 0xA82A);
  1423.  
  1424. EXTERN_API( ComponentResult )
  1425. NAGetController                    (NoteAllocator             na,
  1426.                                  NoteChannel             noteChannel,
  1427.                                  long                     controllerNumber,
  1428.                                  long *                    controllerValue)                    FIVEWORDINLINE(0x2F3C, 0x000C, 0x002D, 0x7000, 0xA82A);
  1429.  
  1430.  
  1431.  
  1432.  
  1433.  
  1434.  
  1435. enum {
  1436.     kTuneQueueDepth                = 8                                /* Deepest you can queue tune segments */
  1437. };
  1438.  
  1439.  
  1440.  
  1441. struct TuneStatus {
  1442.     unsigned long *                    tune;                        /* currently playing tune */
  1443.     unsigned long *                    tunePtr;                    /* position within currently playing piece */
  1444.     TimeValue                         time;                        /* current tune time */
  1445.     short                             queueCount;                    /* how many pieces queued up? */
  1446.     short                             queueSpots;                    /* How many more tunepieces can be queued */
  1447.     TimeValue                         queueTime;                    /* How much time is queued up? (can be very inaccurate) */
  1448.     long                             reserved[3];
  1449. };
  1450. typedef struct TuneStatus                TuneStatus;
  1451. typedef CALLBACK_API( void , TuneCallBackProcPtr )(const TuneStatus *status, long refCon);
  1452. typedef CALLBACK_API( void , TunePlayCallBackProcPtr )(unsigned long *event, long seed, long refCon);
  1453. typedef STACK_UPP_TYPE(TuneCallBackProcPtr)                     TuneCallBackUPP;
  1454. typedef STACK_UPP_TYPE(TunePlayCallBackProcPtr)                 TunePlayCallBackUPP;
  1455.  
  1456. typedef ComponentInstance                 TunePlayer;
  1457.  
  1458. enum {
  1459.     kTunePlayerComponentType    = FOUR_CHAR_CODE('tune')
  1460. };
  1461.  
  1462.  
  1463. EXTERN_API( ComponentResult )
  1464. TuneSetHeader                    (TunePlayer             tp,
  1465.                                  unsigned long *        header)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0004, 0x7000, 0xA82A);
  1466.  
  1467. EXTERN_API( ComponentResult )
  1468. TuneGetTimeBase                    (TunePlayer             tp,
  1469.                                  TimeBase *                tb)                                    FIVEWORDINLINE(0x2F3C, 0x0004, 0x0005, 0x7000, 0xA82A);
  1470.  
  1471. EXTERN_API( ComponentResult )
  1472. TuneSetTimeScale                (TunePlayer             tp,
  1473.                                  TimeScale                 scale)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0006, 0x7000, 0xA82A);
  1474.  
  1475. EXTERN_API( ComponentResult )
  1476. TuneGetTimeScale                (TunePlayer             tp,
  1477.                                  TimeScale *            scale)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0007, 0x7000, 0xA82A);
  1478.  
  1479. EXTERN_API( ComponentResult )
  1480. TuneGetIndexedNoteChannel        (TunePlayer             tp,
  1481.                                  long                     i,
  1482.                                  NoteChannel *            nc)                                    FIVEWORDINLINE(0x2F3C, 0x0008, 0x0008, 0x7000, 0xA82A);
  1483.  
  1484.  
  1485. /* Values for when to start. */
  1486.  
  1487. enum {
  1488.     kTuneStartNow                = 1,                            /* start after buffer is implied */
  1489.     kTuneDontClipNotes            = 2,                            /* allow notes to finish their durations outside sample */
  1490.     kTuneExcludeEdgeNotes        = 4,                            /* dont play notes that start at end of tune */
  1491.     kTuneQuickStart                = 8,                            /* Leave all the controllers where they are, ignore start time */
  1492.     kTuneLoopUntil                = 16,                            /* loop a queued tune if there's nothing else in the queue*/
  1493.     kTunePlayDifference            = 32,                            /* by default, the tune difference is skipped*/
  1494.     kTunePlayConcurrent            = 64,                            /* dont block the next tune sequence with this one*/
  1495.     kTuneStartNewMaster            = 16384
  1496. };
  1497.  
  1498. EXTERN_API( ComponentResult )
  1499. TuneQueue                        (TunePlayer             tp,
  1500.                                  unsigned long *        tune,
  1501.                                  Fixed                     tuneRate,
  1502.                                  unsigned long             tuneStartPosition,
  1503.                                  unsigned long             tuneStopPosition,
  1504.                                  unsigned long             queueFlags,
  1505.                                  TuneCallBackUPP         callBackProc,
  1506.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x001C, 0x000A, 0x7000, 0xA82A);
  1507.  
  1508. EXTERN_API( ComponentResult )
  1509. TuneInstant                        (TunePlayer             tp,
  1510.                                  unsigned long *        tune,
  1511.                                  unsigned long             tunePosition)                        FIVEWORDINLINE(0x2F3C, 0x0008, 0x000B, 0x7000, 0xA82A);
  1512.  
  1513. EXTERN_API( ComponentResult )
  1514. TuneGetStatus                    (TunePlayer             tp,
  1515.                                  TuneStatus *            status)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x000C, 0x7000, 0xA82A);
  1516.  
  1517. /* Values for stopping. */
  1518.  
  1519. enum {
  1520.     kTuneStopFade                = 1,                            /* do a quick, synchronous fadeout */
  1521.     kTuneStopSustain            = 2,                            /* don't silece notes */
  1522.     kTuneStopInstant            = 4,                            /* silence notes fast (else, decay them) */
  1523.     kTuneStopReleaseChannels    = 8                                /* afterwards, let the channels go */
  1524. };
  1525.  
  1526. EXTERN_API( ComponentResult )
  1527. TuneStop                        (TunePlayer             tp,
  1528.                                  long                     stopFlags)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x000D, 0x7000, 0xA82A);
  1529.  
  1530.  
  1531. EXTERN_API( ComponentResult )
  1532. TuneSetVolume                    (TunePlayer             tp,
  1533.                                  Fixed                     volume)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0010, 0x7000, 0xA82A);
  1534.  
  1535. EXTERN_API( ComponentResult )
  1536. TuneGetVolume                    (TunePlayer             tp)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0011, 0x7000, 0xA82A);
  1537.  
  1538. EXTERN_API( ComponentResult )
  1539. TunePreroll                        (TunePlayer             tp)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0012, 0x7000, 0xA82A);
  1540.  
  1541. EXTERN_API( ComponentResult )
  1542. TuneUnroll                        (TunePlayer             tp)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0013, 0x7000, 0xA82A);
  1543.  
  1544. EXTERN_API( ComponentResult )
  1545. TuneSetNoteChannels                (TunePlayer             tp,
  1546.                                  unsigned long             count,
  1547.                                  NoteChannel *            noteChannelList,
  1548.                                  TunePlayCallBackUPP     playCallBackProc,
  1549.                                  long                     refCon)                                FIVEWORDINLINE(0x2F3C, 0x0010, 0x0014, 0x7000, 0xA82A);
  1550.  
  1551. EXTERN_API( ComponentResult )
  1552. TuneSetPartTranspose            (TunePlayer             tp,
  1553.                                  unsigned long             part,
  1554.                                  long                     transpose,
  1555.                                  long                     velocityShift)                        FIVEWORDINLINE(0x2F3C, 0x000C, 0x0015, 0x7000, 0xA82A);
  1556.  
  1557.  
  1558. EXTERN_API( NoteAllocator )
  1559. TuneGetNoteAllocator            (TunePlayer             tp)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0017, 0x7000, 0xA82A);
  1560.  
  1561. EXTERN_API( ComponentResult )
  1562. TuneSetSofter                    (TunePlayer             tp,
  1563.                                  long                     softer)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x0018, 0x7000, 0xA82A);
  1564.  
  1565. EXTERN_API( ComponentResult )
  1566. TuneTask                        (TunePlayer             tp)                                    FIVEWORDINLINE(0x2F3C, 0x0000, 0x0019, 0x7000, 0xA82A);
  1567.  
  1568. EXTERN_API( ComponentResult )
  1569. TuneSetBalance                    (TunePlayer             tp,
  1570.                                  long                     balance)                            FIVEWORDINLINE(0x2F3C, 0x0004, 0x001A, 0x7000, 0xA82A);
  1571.  
  1572. EXTERN_API( ComponentResult )
  1573. TuneSetSoundLocalization        (TunePlayer             tp,
  1574.                                  Handle                 data)                                FIVEWORDINLINE(0x2F3C, 0x0004, 0x001B, 0x7000, 0xA82A);
  1575.  
  1576. EXTERN_API( ComponentResult )
  1577. TuneSetHeaderWithSize            (TunePlayer             tp,
  1578.                                  unsigned long *        header,
  1579.                                  unsigned long             size)                                FIVEWORDINLINE(0x2F3C, 0x0008, 0x001C, 0x7000, 0xA82A);
  1580.  
  1581. /* flags for part mix. */
  1582.  
  1583. enum {
  1584.     kTuneMixMute                = 1,                            /* disable a part */
  1585.     kTuneMixSolo                = 2                                /* if any parts soloed, play only soloed parts */
  1586. };
  1587.  
  1588.  
  1589. EXTERN_API( ComponentResult )
  1590. TuneSetPartMix                    (TunePlayer             tp,
  1591.                                  unsigned long             partNumber,
  1592.                                  long                     volume,
  1593.                                  long                     balance,
  1594.                                  long                     mixFlags)                            FIVEWORDINLINE(0x2F3C, 0x0010, 0x001D, 0x7000, 0xA82A);
  1595.  
  1596. EXTERN_API( ComponentResult )
  1597. TuneGetPartMix                    (TunePlayer             tp,
  1598.                                  unsigned long             partNumber,
  1599.                                  long *                    volumeOut,
  1600.                                  long *                    balanceOut,
  1601.                                  long *                    mixFlagsOut)                        FIVEWORDINLINE(0x2F3C, 0x0010, 0x001E, 0x7000, 0xA82A);
  1602.  
  1603.  
  1604.  
  1605.  
  1606.  
  1607. typedef unsigned long                     MusicOpWord;
  1608. typedef unsigned long *                    MusicOpWordPtr;
  1609. /*     QuickTime Music Track Event Formats:
  1610.  
  1611.     At this time, QuickTime music tracks support 5 different event types -- REST events,
  1612.     short NOTE events, short CONTROL events, short GENERAL events, Long NOTE events, 
  1613.     long CONTROL events, and variable GENERAL events.
  1614.  
  1615.         • REST Event (4 bytes/event):
  1616.     
  1617.             (0 0 0) (5-bit UNUSED) (24-bit Rest Duration)
  1618.         
  1619.         • Short NOTE Events (4 bytes/event):
  1620.     
  1621.             (0 0 1) (5-bit Part) (6-bit Pitch) (7-bit Volume) (11-bit Duration)
  1622.         
  1623.             where:    Pitch is offset by 32 (Actual pitch = pitch field + 32)
  1624.  
  1625.         • Short CONTROL Events (4 bytes/event):
  1626.     
  1627.             (0 1 0) (5-bit Part) (8-bit Controller) (1-bit UNUSED) (1-bit Sign) (7-bit MSB) (7-bit LSB)
  1628.                                                                          ( or 15-bit Signed Value)
  1629.         • Short GENERAL Event (4 bytes/event):
  1630.     
  1631.             (0 1 1) (1-bit UNUSED) (12-bit Sub-Type) (16-bit Value)
  1632.     
  1633.         • Long NOTE Events (8 bytes/event):
  1634.     
  1635.             (1 0 0 1) (12-bit Part) (1-bit UNUSED) (7-bit Pitch) (1-bit UNUSED) (7-bit Volume)
  1636.             (1 0) (8-bit UNUSED) (22-bit Duration)
  1637.         
  1638.         • Long CONTROL Event (8 bytes/event):
  1639.         
  1640.             (1 0 1 0) (12-bit Part) (16-bit Value MSB) 
  1641.             (1 0) (14-bit Controller) (16-bit Value LSB)
  1642.     
  1643.         • Long KNOB Event (8 bytes/event):
  1644.     
  1645.             (1 0 1 1) (12-bit Sub-Type) (16-bit Value MSB)
  1646.             (1 0) (14-bit KNOB) (16-bit Value LSB)
  1647.     
  1648.         • Variable GENERAL Length Events (N bytes/event):
  1649.     
  1650.             (1 1 1 1) (12-bit Sub-Type) (16-bit Length)
  1651.                 :
  1652.             (32-bit Data values)
  1653.                 :
  1654.             (1 1) (14-bit UNUSED) (16-bit Length)
  1655.     
  1656.             where:    Length field is the number of LONG words in the record.
  1657.                     Lengths include the first and last long words (Minimum length = 2)
  1658.                 
  1659.     The following event type values have not been used yet and are reserved for 
  1660.     future expansion:
  1661.         
  1662.         • (1 0 0 0)        (8 bytes/event)
  1663.         • (1 1 0 0)        (N bytes/event)
  1664.         • (1 1 0 1)        (N bytes/event)
  1665.         • (1 1 1 0)        (N bytes/event)
  1666.         
  1667.     For all events, the following generalizations apply:
  1668.     
  1669.         -    All duration values are specified in Millisecond units.
  1670.         -     Pitch values are intended to map directly to the MIDI key numbers.
  1671.         -    Controllers from 0 to 127 correspond to the standard MIDI controllers.
  1672.             Controllers greater than 127 correspond to other controls (i.e., Pitch Bend, 
  1673.             Key Pressure, and Channel Pressure).    
  1674. */
  1675.  
  1676. /* Defines for the implemented music event data fields*/
  1677.  
  1678. enum {
  1679.     kRestEventType                = 0x00000000,                    /* lower 3-bits */
  1680.     kNoteEventType                = 0x00000001,                    /* lower 3-bits */
  1681.     kControlEventType            = 0x00000002,                    /* lower 3-bits */
  1682.     kMarkerEventType            = 0x00000003,                    /* lower 3-bits */
  1683.     kUndefined1EventType        = 0x00000008,                    /* 4-bits */
  1684.     kXNoteEventType                = 0x00000009,                    /* 4-bits */
  1685.     kXControlEventType            = 0x0000000A,                    /* 4-bits */
  1686.     kKnobEventType                = 0x0000000B,                    /* 4-bits */
  1687.     kUndefined2EventType        = 0x0000000C,                    /* 4-bits */
  1688.     kUndefined3EventType        = 0x0000000D,                    /* 4-bits */
  1689.     kUndefined4EventType        = 0x0000000E,                    /* 4-bits */
  1690.     kGeneralEventType            = 0x0000000F,                    /* 4-bits */
  1691.     kXEventLengthBits            = 0x00000002,                    /* 2 bits: indicates 8-byte event record */
  1692.     kGeneralEventLengthBits        = 0x00000003,                    /* 2 bits: indicates variable length event record */
  1693.     kEventLen                    = 1L,                            /* length of events in long words */
  1694.     kXEventLen                    = 2L,
  1695.     kRestEventLen                = kEventLen,                    /* length of events in long words */
  1696.     kNoteEventLen                = kEventLen,
  1697.     kControlEventLen            = kEventLen,
  1698.     kMarkerEventLen                = kEventLen,
  1699.     kXNoteEventLen                = kXEventLen,
  1700.     kXControlEventLen            = kXEventLen,
  1701.     kGeneralEventLen            = kXEventLen,                    /* 2 or more, however */
  1702.                                                                 /* Universal Event Defines*/
  1703.     kEventLengthFieldPos        = 30,                            /* by looking at these two bits of the 1st or last word              */
  1704.     kEventLengthFieldWidth        = 2,                            /* of an event you can determine the event length                      */
  1705.                                                                 /* length field: 0 & 1 => 1 long; 2 => 2 longs; 3 => variable length */
  1706.     kEventTypeFieldPos            = 29,                            /* event type field for short events */
  1707.     kEventTypeFieldWidth        = 3,                            /* short type is 3 bits */
  1708.     kXEventTypeFieldPos            = 28,                            /* event type field for extended events */
  1709.     kXEventTypeFieldWidth        = 4,                            /* extended type is 4 bits */
  1710.     kEventPartFieldPos            = 24,
  1711.     kEventPartFieldWidth        = 5,
  1712.     kXEventPartFieldPos            = 16,                            /* in the 1st long word */
  1713.     kXEventPartFieldWidth        = 12,                            /* Rest Events*/
  1714.     kRestEventDurationFieldPos    = 0,
  1715.     kRestEventDurationFieldWidth = 24,
  1716.     kRestEventDurationMax        = ((1L << kRestEventDurationFieldWidth) - 1), /* Note Events*/
  1717.     kNoteEventPitchFieldPos        = 18,
  1718.     kNoteEventPitchFieldWidth    = 6,
  1719.     kNoteEventPitchOffset        = 32,                            /* add to value in pitch field to get actual pitch */
  1720.     kNoteEventVolumeFieldPos    = 11,
  1721.     kNoteEventVolumeFieldWidth    = 7,
  1722.     kNoteEventVolumeOffset        = 0,                            /* add to value in volume field to get actual volume */
  1723.     kNoteEventDurationFieldPos    = 0,
  1724.     kNoteEventDurationFieldWidth = 11,
  1725.     kNoteEventDurationMax        = ((1L << kNoteEventDurationFieldWidth) - 1),
  1726.     kXNoteEventPitchFieldPos    = 0,                            /* in the 1st long word */
  1727.     kXNoteEventPitchFieldWidth    = 16,
  1728.     kXNoteEventDurationFieldPos    = 0,                            /* in the 2nd long word */
  1729.     kXNoteEventDurationFieldWidth = 22,
  1730.     kXNoteEventDurationMax        = ((1L << kXNoteEventDurationFieldWidth) - 1),
  1731.     kXNoteEventVolumeFieldPos    = 22,                            /* in the 2nd long word */
  1732.     kXNoteEventVolumeFieldWidth    = 7,                            /* Control Events*/
  1733.     kControlEventControllerFieldPos = 16,
  1734.     kControlEventControllerFieldWidth = 8,
  1735.     kControlEventValueFieldPos    = 0,
  1736.     kControlEventValueFieldWidth = 16,
  1737.     kXControlEventControllerFieldPos = 0,                        /* in the 2nd long word */
  1738.     kXControlEventControllerFieldWidth = 16,
  1739.     kXControlEventValueFieldPos    = 0,                            /* in the 1st long word */
  1740.     kXControlEventValueFieldWidth = 16,                            /* Knob Events*/
  1741.     kKnobEventValueHighFieldPos    = 0,                            /* 1st long word */
  1742.     kKnobEventValueHighFieldWidth = 16,
  1743.     kKnobEventKnobFieldPos        = 16,                            /* 2nd long word */
  1744.     kKnobEventKnobFieldWidth    = 14,
  1745.     kKnobEventValueLowFieldPos    = 0,                            /* 2nd long word */
  1746.     kKnobEventValueLowFieldWidth = 16,                            /* Marker Events*/
  1747.     kMarkerEventSubtypeFieldPos    = 16,
  1748.     kMarkerEventSubtypeFieldWidth = 8,
  1749.     kMarkerEventValueFieldPos    = 0,
  1750.     kMarkerEventValueFieldWidth    = 16,                            /* General Events*/
  1751.     kGeneralEventSubtypeFieldPos = 16,                            /* in the last long word */
  1752.     kGeneralEventSubtypeFieldWidth = 14,
  1753.     kGeneralEventLengthFieldPos    = 0,                            /* in the 1st & last long words */
  1754.     kGeneralEventLengthFieldWidth = 16
  1755. };
  1756.  
  1757. #if TARGET_RT_LITTLE_ENDIAN
  1758.  
  1759. enum {
  1760.     kEndMarkerValue                = 0x00000060
  1761. };
  1762.  
  1763. #else
  1764.  
  1765. enum {
  1766.     kEndMarkerValue                = 0x60000000
  1767. };
  1768.  
  1769. #endif  /* TARGET_RT_LITTLE_ENDIAN */
  1770.  
  1771. /* macros for extracting various fields from the QuickTime event records*/
  1772. #define qtma_MASK(bitWidth)             ((1L << (bitWidth)) - 1)
  1773. #define qtma_EXT(val, pos, width)         ((EndianU32_BtoN(val) >> (pos)) & qtma_MASK(width))
  1774. #define qtma_EventLengthForward(xP,ulen)        \
  1775.     {                                            \
  1776.         unsigned long _ext;                            \
  1777.         unsigned long *lP = (unsigned long *)(xP);    \
  1778.         _ext = qtma_EXT(*lP, kEventLengthFieldPos, kEventLengthFieldWidth); \
  1779.         if (_ext != 3) {                        \
  1780.             ulen = (_ext < 2) ? 1 : 2;            \
  1781.         } else {                                \
  1782.             ulen = (unsigned short)qtma_EXT(*lP, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth); \
  1783.             if (ulen < 2) {                        \
  1784.                 ulen = lP[1];                    \
  1785.             }                                    \
  1786.         }                                        \
  1787.     }
  1788. #define qtma_EventLengthBackward(xP,ulen)        \
  1789.     {                                            \
  1790.         unsigned long _ext;                        \
  1791.         unsigned long *lP = (unsigned long *)(xP); \
  1792.         _ext = qtma_EXT(*lP, kEventLengthFieldPos, kEventLengthFieldWidth);        \
  1793.         if (_ext != 3) {                        \
  1794.             ulen = (_ext < 2) ? 1 : 2;            \
  1795.         } else {                                \
  1796.             ulen = (unsigned short)qtma_EXT(*lP, kGeneralEventLengthFieldPos, kGeneralEventLengthFieldWidth);        \
  1797.             if (ulen < 2) {                        \
  1798.                 ulen = lP[-1];                    \
  1799.             }                                    \
  1800.         }                                        \
  1801.     }
  1802. #define qtma_EventType(x)                 ((qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth) > 3) ? qtma_EXT(x, kXEventTypeFieldPos, kXEventTypeFieldWidth) : qtma_EXT(x, kEventTypeFieldPos, kEventTypeFieldWidth))
  1803. #define qtma_RestDuration(x)              (qtma_EXT(x, kRestEventDurationFieldPos, kRestEventDurationFieldWidth))
  1804. #define qtma_Part(x)                     (qtma_EXT(x, kEventPartFieldPos, kEventPartFieldWidth))
  1805. #define qtma_XPart(m, l)                 (qtma_EXT(m, kXEventPartFieldPos, kXEventPartFieldWidth))
  1806. #define qtma_NotePitch(x)                 (qtma_EXT(x, kNoteEventPitchFieldPos, kNoteEventPitchFieldWidth) + kNoteEventPitchOffset)
  1807. #define qtma_NoteVolume(x)                 (qtma_EXT(x, kNoteEventVolumeFieldPos, kNoteEventVolumeFieldWidth) + kNoteEventVolumeOffset)
  1808. #define qtma_NoteDuration(x)             (qtma_EXT(x, kNoteEventDurationFieldPos, kNoteEventDurationFieldWidth))
  1809. #define qtma_NoteVelocity qtma_NoteVolume
  1810. #define qtma_XNotePitch(m, l)             (qtma_EXT(m, kXNoteEventPitchFieldPos, kXNoteEventPitchFieldWidth))
  1811. #define qtma_XNoteVolume(m, l)             (qtma_EXT(l, kXNoteEventVolumeFieldPos, kXNoteEventVolumeFieldWidth))
  1812. #define qtma_XNoteDuration(m, l)         (qtma_EXT(l, kXNoteEventDurationFieldPos, kXNoteEventDurationFieldWidth))
  1813. #define qtma_XNoteVelocity qtma_XNoteVolume
  1814. #define qtma_ControlController(x)         (qtma_EXT(x, kControlEventControllerFieldPos, kControlEventControllerFieldWidth))
  1815. #define qtma_ControlValue(x)             (qtma_EXT(x, kControlEventValueFieldPos, kControlEventValueFieldWidth))
  1816. #define qtma_XControlController(m, l)     (qtma_EXT(l, kXControlEventControllerFieldPos, kXControlEventControllerFieldWidth))
  1817. #define qtma_XControlValue(m, l)         (qtma_EXT(m, kXControlEventValueFieldPos, kXControlEventValueFieldWidth))
  1818. #define qtma_MarkerSubtype(x)            (qtma_EXT(x,kMarkerEventSubtypeFieldPos,kMarkerEventSubtypeFieldWidth))
  1819. #define qtma_MarkerValue(x)             (qtma_EXT(x, kMarkerEventValueFieldPos, kMarkerEventValueFieldWidth))
  1820.  
  1821. #define qtma_KnobValue(m,l)                ((qtma_EXT(m,kKnobEventValueHighFieldPos,kKnobEventValueHighFieldWidth) << 16)    \
  1822.                                         | (qtma_EXT(l,kKnobEventValueLowFieldPos,kKnobEventValueLowFieldWidth)))
  1823.  
  1824. #define qtma_KnobKnob(m,l)                (qtma_EXT(l,kKnobEventKnobFieldPos,kKnobEventKnobFieldWidth))
  1825. #define qtma_GeneralSubtype(m,l)        (qtma_EXT(l,kGeneralEventSubtypeFieldPos,kGeneralEventSubtypeFieldWidth))
  1826. #define qtma_GeneralLength(m,l)           (qtma_EXT(m,kGeneralEventLengthFieldPos,kGeneralEventLengthFieldWidth))
  1827. #define qtma_StuffRestEvent(x, duration) ( \
  1828.     x =       (kRestEventType << kEventTypeFieldPos)    \
  1829.         |  ((long)(duration) << kRestEventDurationFieldPos),    \
  1830.     x = EndianU32_NtoB(x) )
  1831. #define qtma_StuffNoteEvent(x, part, pitch, volume, duration) ( \
  1832.     x =        (kNoteEventType << kEventTypeFieldPos)    \
  1833.         |     ((long)(part) << kEventPartFieldPos)    \
  1834.         |    (((long)(pitch) - kNoteEventPitchOffset) << kNoteEventPitchFieldPos)    \
  1835.         |    (((long)(volume) - kNoteEventVolumeOffset) << kNoteEventVolumeFieldPos)    \
  1836.         |    ((long)(duration) << kNoteEventDurationFieldPos), \
  1837.     x = EndianU32_NtoB(x) )
  1838. #define qtma_StuffControlEvent(x, part, control, value) ( \
  1839.     x =        (kControlEventType << kEventTypeFieldPos)            \
  1840.         |     ((long)(part) << kEventPartFieldPos)                \
  1841.         |    ((long)(control) << kControlEventControllerFieldPos)\
  1842.         |    ((long)((value) & qtma_MASK(kControlEventValueFieldWidth)) << kControlEventValueFieldPos), \
  1843.     x = EndianU32_NtoB(x) )
  1844. #define qtma_StuffMarkerEvent(x, markerType, markerValue) ( \
  1845.     x =     (kMarkerEventType << kEventTypeFieldPos)    \
  1846.         |     ((long)(markerType) << kMarkerEventSubtypeFieldPos)    \
  1847.         |    ((long)(markerValue) << kMarkerEventValueFieldPos), \
  1848.     x = EndianU32_NtoB(x) )
  1849. #define qtma_StuffXNoteEvent(w1, w2, part, pitch, volume, duration) ( \
  1850.     w1 =     (kXNoteEventType << kXEventTypeFieldPos)            \
  1851.         |    ((long)(part) << kXEventPartFieldPos)                \
  1852.         |    ((long)(pitch) << kXNoteEventPitchFieldPos),        \
  1853.     w1 = EndianU32_NtoB(w1),                                    \
  1854.     w2 =     (kXEventLengthBits << kEventLengthFieldPos)        \
  1855.         |    ((long)(duration) << kXNoteEventDurationFieldPos)    \
  1856.         |    ((long)(volume) << kXNoteEventVolumeFieldPos),        \
  1857.     w2 = EndianU32_NtoB(w2) )
  1858. #define qtma_StuffXControlEvent(w1, w2, part, control, value) (        \
  1859.     w1 =     (kXControlEventType << kXEventTypeFieldPos)                \
  1860.         |    ((long)(part) << kXEventPartFieldPos)                    \
  1861.         |    ((long)((value) & qtma_MASK(kXControlEventValueFieldWidth)) << kXControlEventValueFieldPos), \
  1862.     w1 = EndianU32_NtoB(w1),                                        \
  1863.     w2 =     (kXEventLengthBits << kEventLengthFieldPos)                \
  1864.         |    ((long)(control) << kXControlEventControllerFieldPos),    \
  1865.     w2 = EndianU32_NtoB(w2) )
  1866. #define qtma_StuffKnobEvent(w1, w2, part, knob, value) ( \
  1867.     w1 =     (kKnobEventType << kXEventTypeFieldPos)                    \
  1868.         |    ((long)(part) << kXEventPartFieldPos)                    \
  1869.         |    ((long)(value >> 16) << kKnobEventValueLowFieldPos),    \
  1870.     w1 = EndianU32_NtoB(w1),                                        \
  1871.     w2 =     (kXEventLengthBits << kEventLengthFieldPos)                \
  1872.         |    ((long)(knob) << kKnobEventKnobFieldPos)                \
  1873.         |    ((long)(value & 0xFFFF) << kKnobEventValueLowFieldPos), \
  1874.     w2 = EndianU32_NtoB(w2) )
  1875. #define qtma_StuffGeneralEvent(w1,w2,part,subType,length) ( \
  1876.     w1 =    (kGeneralEventType << kXEventTypeFieldPos)                \
  1877.         |    ((long)(part) << kXEventPartFieldPos)                    \
  1878.         |    ((long)(length) << kGeneralEventLengthFieldPos),        \
  1879.     w1 = EndianU32_NtoB(w1),                                        \
  1880.     w2 = (kGeneralEventLengthBits << kEventLengthFieldPos)            \
  1881.         |    ((long)(subType) << kGeneralEventSubtypeFieldPos)        \
  1882.         |    ((long)(length) << kGeneralEventLengthFieldPos),        \
  1883.     w2 = EndianU32_NtoB(w2) )
  1884. #define qtma_NeedXGeneralEvent(length)     (((unsigned long)(length)) > (unsigned long)0xffff)
  1885. /* General Event Defined Types*/
  1886.  
  1887. enum {
  1888.     kGeneralEventNoteRequest    = 1,                            /* Encapsulates NoteRequest data structure */
  1889.     kGeneralEventPartKey        = 4,
  1890.     kGeneralEventTuneDifference    = 5,                            /* Contains a standard sequence, with end marker, for the tune difference of a sequence piece (halts QuickTime 2.0 Music) */
  1891.     kGeneralEventAtomicInstrument = 6,                            /* Encapsulates AtomicInstrument record */
  1892.     kGeneralEventKnob            = 7,                            /* knobID/knobValue pairs; smallest event is 4 longs */
  1893.     kGeneralEventMIDIChannel    = 8,                            /* used in tune header, one longword identifies the midi channel it originally came from */
  1894.     kGeneralEventPartChange        = 9,                            /* used in tune sequence, one longword identifies the tune part which can now take over this part's note channel (similar to program change) (halts QuickTime 2.0 Music)*/
  1895.     kGeneralEventNoOp            = 10,                            /* guaranteed to do nothing and be ignored. (halts QuickTime 2.0 Music) */
  1896.     kGeneralEventUsedNotes        = 11,                            /* four longwords specifying which midi notes are actually used, 0..127 msb to lsb */
  1897.     kGeneralEventPartMix        = 12                            /* three longwords: Fixed volume, long balance, long flags */
  1898. };
  1899.  
  1900. /* Marker Event Defined Types        // marker is 60 ee vv vv in hex, where e = event type, and v = value*/
  1901.  
  1902. enum {
  1903.     kMarkerEventEnd                = 0,                            /* marker type 0 means: value 0 - stop, value != 0 - ignore*/
  1904.     kMarkerEventBeat            = 1,                            /* value 0 = single beat; anything else is 65536ths-of-a-beat (quarter note)*/
  1905.     kMarkerEventTempo            = 2                                /* value same as beat marker, but indicates that a tempo event should be computed (based on where the next beat or tempo marker is) and emitted upon export*/
  1906. };
  1907.  
  1908.  
  1909. enum {
  1910.     kCurrentlyNativeEndian        = 1,
  1911.     kCurrentlyNotNativeEndian    = 2
  1912. };
  1913.  
  1914. /* UPP call backs */
  1915. enum { uppMusicMIDISendProcInfo = 0x00000FF0 };                 /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  1916. enum { uppMusicMIDIReadHookProcInfo = 0x000003F0 };             /* pascal 4_bytes Func(4_bytes, 4_bytes) */
  1917. enum { uppMusicOfflineDataProcInfo = 0x00000FF0 };                 /* pascal 4_bytes Func(4_bytes, 4_bytes, 4_bytes) */
  1918. enum { uppTuneCallBackProcInfo = 0x000003C0 };                     /* pascal no_return_value Func(4_bytes, 4_bytes) */
  1919. enum { uppTunePlayCallBackProcInfo = 0x00000FC0 };                 /* pascal no_return_value Func(4_bytes, 4_bytes, 4_bytes) */
  1920. #define NewMusicMIDISendProc(userRoutine)                         (MusicMIDISendUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDISendProcInfo, GetCurrentArchitecture())
  1921. #define NewMusicMIDIReadHookProc(userRoutine)                     (MusicMIDIReadHookUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicMIDIReadHookProcInfo, GetCurrentArchitecture())
  1922. #define NewMusicOfflineDataProc(userRoutine)                     (MusicOfflineDataUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppMusicOfflineDataProcInfo, GetCurrentArchitecture())
  1923. #define NewTuneCallBackProc(userRoutine)                         (TuneCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTuneCallBackProcInfo, GetCurrentArchitecture())
  1924. #define NewTunePlayCallBackProc(userRoutine)                     (TunePlayCallBackUPP)NewRoutineDescriptor((ProcPtr)(userRoutine), uppTunePlayCallBackProcInfo, GetCurrentArchitecture())
  1925. #define CallMusicMIDISendProc(userRoutine, self, refCon, mmp)     CALL_THREE_PARAMETER_UPP((userRoutine), uppMusicMIDISendProcInfo, (self), (refCon), (mmp))
  1926. #define CallMusicMIDIReadHookProc(userRoutine, mp, myRefCon)     CALL_TWO_PARAMETER_UPP((userRoutine), uppMusicMIDIReadHookProcInfo, (mp), (myRefCon))
  1927. #define CallMusicOfflineDataProc(userRoutine, SoundData, numBytes, myRefCon)  CALL_THREE_PARAMETER_UPP((userRoutine), uppMusicOfflineDataProcInfo, (SoundData), (numBytes), (myRefCon))
  1928. #define CallTuneCallBackProc(userRoutine, status, refCon)         CALL_TWO_PARAMETER_UPP((userRoutine), uppTuneCallBackProcInfo, (status), (refCon))
  1929. #define CallTunePlayCallBackProc(userRoutine, event, seed, refCon)  CALL_THREE_PARAMETER_UPP((userRoutine), uppTunePlayCallBackProcInfo, (event), (seed), (refCon))
  1930.  
  1931. /* selectors for component calls */
  1932. enum {
  1933.     kQTMIDIGetMIDIPortsSelect                        = 0x0001,
  1934.     kQTMIDIUseSendPortSelect                        = 0x0002,
  1935.     kQTMIDISendMIDISelect                            = 0x0003,
  1936.     kQTMIDIUseReceivePortSelect                        = 0x0004,
  1937.     kMusicGetDescriptionSelect                        = 0x0001,
  1938.     kMusicGetPartSelect                                = 0x0002,
  1939.     kMusicSetPartSelect                                = 0x0003,
  1940.     kMusicSetPartInstrumentNumberSelect                = 0x0004,
  1941.     kMusicGetPartInstrumentNumberSelect                = 0x0005,
  1942.     kMusicStorePartInstrumentSelect                    = 0x0006,
  1943.     kMusicGetPartAtomicInstrumentSelect                = 0x0009,
  1944.     kMusicSetPartAtomicInstrumentSelect                = 0x000A,
  1945.     kMusicGetInstrumentKnobDescriptionObsoleteSelect = 0x000D,
  1946.     kMusicGetDrumKnobDescriptionObsoleteSelect        = 0x000E,
  1947.     kMusicGetKnobDescriptionObsoleteSelect            = 0x000F,
  1948.     kMusicGetPartKnobSelect                            = 0x0010,
  1949.     kMusicSetPartKnobSelect                            = 0x0011,
  1950.     kMusicGetKnobSelect                                = 0x0012,
  1951.     kMusicSetKnobSelect                                = 0x0013,
  1952.     kMusicGetPartNameSelect                            = 0x0014,
  1953.     kMusicSetPartNameSelect                            = 0x0015,
  1954.     kMusicFindToneSelect                            = 0x0016,
  1955.     kMusicPlayNoteSelect                            = 0x0017,
  1956.     kMusicResetPartSelect                            = 0x0018,
  1957.     kMusicSetPartControllerSelect                    = 0x0019,
  1958.     kMusicGetPartControllerSelect                    = 0x001A,
  1959.     kMusicGetMIDIProcSelect                            = 0x001B,
  1960.     kMusicSetMIDIProcSelect                            = 0x001C,
  1961.     kMusicGetInstrumentNamesSelect                    = 0x001D,
  1962.     kMusicGetDrumNamesSelect                        = 0x001E,
  1963.     kMusicGetMasterTuneSelect                        = 0x001F,
  1964.     kMusicSetMasterTuneSelect                        = 0x0020,
  1965.     kMusicGetInstrumentAboutInfoSelect                = 0x0022,
  1966.     kMusicGetDeviceConnectionSelect                    = 0x0023,
  1967.     kMusicUseDeviceConnectionSelect                    = 0x0024,
  1968.     kMusicGetKnobSettingStringsSelect                = 0x0025,
  1969.     kMusicGetMIDIPortsSelect                        = 0x0026,
  1970.     kMusicSendMIDISelect                            = 0x0027,
  1971.     kMusicReceiveMIDISelect                            = 0x0028,
  1972.     kMusicStartOfflineSelect                        = 0x0029,
  1973.     kMusicSetOfflineTimeToSelect                    = 0x002A,
  1974.     kMusicGetInstrumentKnobDescriptionSelect        = 0x002B,
  1975.     kMusicGetDrumKnobDescriptionSelect                = 0x002C,
  1976.     kMusicGetKnobDescriptionSelect                    = 0x002D,
  1977.     kMusicGetInfoTextSelect                            = 0x002E,
  1978.     kMusicGetInstrumentInfoSelect                    = 0x002F,
  1979.     kMusicTaskSelect                                = 0x0031,
  1980.     kMusicSetPartInstrumentNumberInterruptSafeSelect = 0x0032,
  1981.     kMusicSetPartSoundLocalizationSelect            = 0x0033,
  1982.     kMusicGenericConfigureSelect                    = 0x0100,
  1983.     kMusicGenericGetPartSelect                        = 0x0101,
  1984.     kMusicGenericGetKnobListSelect                    = 0x0102,
  1985.     kMusicGenericSetResourceNumbersSelect            = 0x0103,
  1986.     kMusicDerivedMIDISendSelect                        = 0x0200,
  1987.     kMusicDerivedSetKnobSelect                        = 0x0201,
  1988.     kMusicDerivedSetPartSelect                        = 0x0202,
  1989.     kMusicDerivedSetInstrumentSelect                = 0x0203,
  1990.     kMusicDerivedSetPartInstrumentNumberSelect        = 0x0204,
  1991.     kMusicDerivedSetMIDISelect                        = 0x0205,
  1992.     kMusicDerivedStorePartInstrumentSelect            = 0x0206,
  1993.     kMusicDerivedOpenResFileSelect                    = 0x0207,
  1994.     kMusicDerivedCloseResFileSelect                    = 0x0208,
  1995.     kInstrumentGetInstSelect                        = 0x0001,
  1996.     kInstrumentGetInfoSelect                        = 0x0002,
  1997.     kInstrumentInitializeSelect                        = 0x0003,
  1998.     kInstrumentOpenComponentResFileSelect            = 0x0004,
  1999.     kInstrumentCloseComponentResFileSelect            = 0x0005,
  2000.     kInstrumentGetComponentRefConSelect                = 0x0006,
  2001.     kInstrumentSetComponentRefConSelect                = 0x0007,
  2002.     kInstrumentGetSynthesizerTypeSelect                = 0x0008,
  2003.     kNARegisterMusicDeviceSelect                    = 0x0000,
  2004.     kNAUnregisterMusicDeviceSelect                    = 0x0001,
  2005.     kNAGetRegisteredMusicDeviceSelect                = 0x0002,
  2006.     kNASaveMusicConfigurationSelect                    = 0x0003,
  2007.     kNANewNoteChannelSelect                            = 0x0004,
  2008.     kNADisposeNoteChannelSelect                        = 0x0005,
  2009.     kNAGetNoteChannelInfoSelect                        = 0x0006,
  2010.     kNAPrerollNoteChannelSelect                        = 0x0007,
  2011.     kNAUnrollNoteChannelSelect                        = 0x0008,
  2012.     kNASetNoteChannelVolumeSelect                    = 0x000B,
  2013.     kNAResetNoteChannelSelect                        = 0x000C,
  2014.     kNAPlayNoteSelect                                = 0x000D,
  2015.     kNASetControllerSelect                            = 0x000E,
  2016.     kNASetKnobSelect                                = 0x000F,
  2017.     kNAFindNoteChannelToneSelect                    = 0x0010,
  2018.     kNASetInstrumentNumberSelect                    = 0x0011,
  2019.     kNAPickInstrumentSelect                            = 0x0012,
  2020.     kNAPickArrangementSelect                        = 0x0013,
  2021.     kNASetDefaultMIDIInputSelect                    = 0x0015,
  2022.     kNAGetDefaultMIDIInputSelect                    = 0x0016,
  2023.     kNAUseDefaultMIDIInputSelect                    = 0x0019,
  2024.     kNALoseDefaultMIDIInputSelect                    = 0x001A,
  2025.     kNAStuffToneDescriptionSelect                    = 0x001B,
  2026.     kNACopyrightDialogSelect                        = 0x001C,
  2027.     kNAGetIndNoteChannelSelect                        = 0x001F,
  2028.     kNAGetMIDIPortsSelect                            = 0x0021,
  2029.     kNAGetNoteRequestSelect                            = 0x0022,
  2030.     kNASendMIDISelect                                = 0x0023,
  2031.     kNAPickEditInstrumentSelect                        = 0x0024,
  2032.     kNANewNoteChannelFromAtomicInstrumentSelect        = 0x0025,
  2033.     kNASetAtomicInstrumentSelect                    = 0x0026,
  2034.     kNAGetKnobSelect                                = 0x0028,
  2035.     kNATaskSelect                                    = 0x0029,
  2036.     kNASetNoteChannelBalanceSelect                    = 0x002A,
  2037.     kNASetInstrumentNumberInterruptSafeSelect        = 0x002B,
  2038.     kNASetNoteChannelSoundLocalizationSelect        = 0x002C,
  2039.     kNAGetControllerSelect                            = 0x002D,
  2040.     kTuneSetHeaderSelect                            = 0x0004,
  2041.     kTuneGetTimeBaseSelect                            = 0x0005,
  2042.     kTuneSetTimeScaleSelect                            = 0x0006,
  2043.     kTuneGetTimeScaleSelect                            = 0x0007,
  2044.     kTuneGetIndexedNoteChannelSelect                = 0x0008,
  2045.     kTuneQueueSelect                                = 0x000A,
  2046.     kTuneInstantSelect                                = 0x000B,
  2047.     kTuneGetStatusSelect                            = 0x000C,
  2048.     kTuneStopSelect                                    = 0x000D,
  2049.     kTuneSetVolumeSelect                            = 0x0010,
  2050.     kTuneGetVolumeSelect                            = 0x0011,
  2051.     kTunePrerollSelect                                = 0x0012,
  2052.     kTuneUnrollSelect                                = 0x0013,
  2053.     kTuneSetNoteChannelsSelect                        = 0x0014,
  2054.     kTuneSetPartTransposeSelect                        = 0x0015,
  2055.     kTuneGetNoteAllocatorSelect                        = 0x0017,
  2056.     kTuneSetSofterSelect                            = 0x0018,
  2057.     kTuneTaskSelect                                    = 0x0019,
  2058.     kTuneSetBalanceSelect                            = 0x001A,
  2059.     kTuneSetSoundLocalizationSelect                    = 0x001B,
  2060.     kTuneSetHeaderWithSizeSelect                    = 0x001C,
  2061.     kTuneSetPartMixSelect                            = 0x001D,
  2062.     kTuneGetPartMixSelect                            = 0x001E
  2063. };
  2064.  
  2065.  
  2066. #if PRAGMA_STRUCT_ALIGN
  2067.     #pragma options align=reset
  2068. #elif PRAGMA_STRUCT_PACKPUSH
  2069.     #pragma pack(pop)
  2070. #elif PRAGMA_STRUCT_PACK
  2071.     #pragma pack()
  2072. #endif
  2073.  
  2074. #ifdef PRAGMA_IMPORT_OFF
  2075. #pragma import off
  2076. #elif PRAGMA_IMPORT
  2077. #pragma import reset
  2078. #endif
  2079.  
  2080. #ifdef __cplusplus
  2081. }
  2082. #endif
  2083.  
  2084. #endif /* __QUICKTIMEMUSIC__ */
  2085.  
  2086.